Package org.jboss.ejb3.core.test.stateful

Examples of org.jboss.ejb3.core.test.stateful.StatefulLocalBusiness


         Kernel sanders = this.kernel;
         assert sanders != null : Kernel.class.getSimpleName() + " must be provided in order to bind "
               + Ejb3Registrar.class.getSimpleName();

         // Create an EJB3 Registrar
         Ejb3Registrar registrar = new Ejb3McRegistrar(sanders);

         // Bind Registrar to the Locator
         Ejb3RegistrarLocator.bindRegistrar(registrar);
        
         // Log
View Full Code Here


      {
         SessionProxyInvocationHandler handler = (SessionProxyInvocationHandler) Proxy.getInvocationHandler(reference);
         id = (Serializable) handler.getTarget();
      }

      @Deprecated
      Ejb3Registrar registrar = Ejb3RegistrarLocator.locateRegistrar();

      // Get the resolver
      EndpointResolver resolver = registrar.lookup(MC_BIND_NAME_ENDPOINT_RESOLVER, EndpointResolver.class);
      this.ejbClassName = descriptor.getBeanClass().getSimpleName();
      endpointMcBindName = resolver.resolve(deploymentUnit, ejbClassName);
      this.stateful = descriptor.isStateful();
   }
View Full Code Here

      }
   }

   private Endpoint getEndpoint()
   {
      @Deprecated
      Ejb3Registrar registrar = Ejb3RegistrarLocator.locateRegistrar();
      return registrar.lookup(endpointMcBindName, Endpoint.class);
   }
View Full Code Here

         Kernel sanders = this.kernel;
         assert sanders != null : Kernel.class.getSimpleName() + " must be provided in order to bind "
               + Ejb3Registrar.class.getSimpleName();

         // Create an EJB3 Registrar
         Ejb3Registrar registrar = new Ejb3McRegistrar(sanders);

         // Bind Registrar to the Locator
         Ejb3RegistrarLocator.bindRegistrar(registrar);
        
         // Log
View Full Code Here

    */
   @Test
   public void testSfsbSessionPersistenceBetweenInvocations() throws Throwable
   {
      // Lookup a new instance
      StatefulLocalBusiness bean1 = this.lookupLocalSfsb();

      // Initialize a counter
      int counter1 = bean1.getNextCounter();

      // Ensure invocation succeeded
      assertEquals("Counter should have been started at 1", 1, counter1);

      // Ensure counter is incremented in same session
      counter1 = bean1.getNextCounter();
      assertEquals("Counter should have been incremented", 2, counter1);

      // Lookup a new instance
      StatefulLocalBusiness bean2 = this.lookupLocalSfsb();

      // Initialize a new counter for this session
      int counter2 = bean2.getNextCounter();

      // Ensure sessions have not overlapped
      assertEquals("Counter for new session should have been started at 1", 1, counter2);
   }
View Full Code Here

    * Obtains a new SFSB instance
    */
   protected StatefulLocalBusiness lookupLocalSfsb() throws NamingException
   {
      String jndiName = this.getBaseJndiName() + "local";
      StatefulLocalBusiness obj = null;
      return this.lookupBean(obj, jndiName);
   }
View Full Code Here

    * EJBTHREE-1496: preDestroy must be called on remove.
    */
   @Test
   public void testPreDestroy() throws NamingException
   {
      StatefulLocalBusiness bean = lookupLocalSfsb();
      bean.remove();
     
      assertEquals("Wrong number of PreDestroy invocations", 1, StatefulBean.preDestroys);
   }
View Full Code Here

      //DeploymentScope scope = null;
      if (unit.getParent() != null)
      {
         boolean isEar = unit != unit.getTopLevel();
         this.deploymentScope = new JBoss5DeploymentScope(unit.getParent(), isEar);
      }

      ejbResolver = new ClientEjbResolver(deploymentScope, unit.getSimpleName());
      messageDestinationResolver = new MessageDestinationResolver(deploymentScope, xml.getMessageDestinations());
View Full Code Here

         throw new NullPointerException("applicationClientName is mandatory");
      if (classLoader == null)
         throw new NullPointerException("classLoader is mandatory");

      this.deploymentUnit = unit;
      this.ejb3Unit = new JBoss5DeploymentUnit(unit);
      this.clientMetaData = xml;
      this.mainClass = mainClass;
      this.applicationClientName = applicationClientName;
      this.classLoader = classLoader;
View Full Code Here

    * @param shortName
    */
   public JBoss5DeploymentScope(VFSDeploymentUnit parent, boolean isEar, String shortName)
   {
      this(parent, isEar);
      ejbRefResolver = new EjbModuleEjbResolver(this, shortName);
   }
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.core.test.stateful.StatefulLocalBusiness

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.