Package org.jboss.test.ejb.proxy.beans

Examples of org.jboss.test.ejb.proxy.beans.StatefulCounter


   {
      getLog().debug(getName());

      Object ref = getInitialContext().lookup("ejb/StatefulCounterEjb");
      StatefulCounterHome home = (StatefulCounterHome) PortableRemoteObject.narrow(ref, StatefulCounterHome.class);
      StatefulCounter counter = home.create();

      assertEquals(1, counter.count());
      assertEquals(2, counter.count());

      ManagementView mgtView = getManagementView();
      mgtView.load();
      Set<ManagedComponent> comps = mgtView.getComponentsForType(new ComponentType("EJB", "StatefulSession"));
      for (ManagedComponent comp : comps)
View Full Code Here


   {
      getLog().debug(getName());
     
      Object ref = getInitialContext().lookup("ejb/StatefulCounterEjb");
      StatefulCounterHome home = (StatefulCounterHome) PortableRemoteObject.narrow(ref, StatefulCounterHome.class);
      StatefulCounter counter = home.create();

      assertEquals(1, counter.count());
      assertEquals(2, counter.count());

      RetrievalMethodHandle handle = (RetrievalMethodHandle)counter.getHandle();
      counter = (StatefulCounter) handle.getEJBObject();
     
      assertEquals(3, counter.count());
      assertEquals(4, counter.count());
     
      assertTrue(handle.isGotEjbObjectViaJndi());
      assertFalse(handle.isGotEjbObjectViaInvoker());
     
      System.setProperty("org.jboss.ejb.sfsb.handle.V327", "whateveryouwant");
     
      handle = (RetrievalMethodHandle)counter.getHandle();
      counter = (StatefulCounter) handle.getEJBObject();

      assertEquals(5, counter.count());
      assertEquals(6, counter.count());
     
      assertFalse(handle.isGotEjbObjectViaJndi());
      assertTrue(handle.isGotEjbObjectViaInvoker());     
   }  
View Full Code Here

TOP

Related Classes of org.jboss.test.ejb.proxy.beans.StatefulCounter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.