Package org.jboss.ejb3.core.test.ejbthree1703

Examples of org.jboss.ejb3.core.test.ejbthree1703.NoopBean


      {
         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 testCreateCount() throws Exception
   {
      NoopLocal bean = lookup("NoopBean/local", NoopLocal.class);
      bean.noop();
      assertEquals(1, container.getPool().getCreateCount());
      assertEquals("the pool should have grown", 1, container.getPool().getMaxSize());
      assertEquals("the instance should be available", 1, container.getPool().getAvailableCount());
   }
View Full Code Here

    * InUse is calculated as: inUse = maxSize - available
    */
   @Test
   public void testInUse() throws Exception
   {
      final NoopLocal bean = lookup("NoopBean/local", NoopLocal.class);
      ExecutorService service = Executors.newSingleThreadExecutor();
      // exercise the thread
      /*
      Future<Void> future = service.submit(new Callable<Void> () {
         public Void call() throws Exception
         {
            bean.noop();
            return null;
         }
      });
      future.get(5, SECONDS);
      assertEquals(1, container.getPool().getCreateCount());
      assertEquals("the pool should have grown", 1, container.getPool().getMaxSize());
      assertEquals("the instance should be available", 1, container.getPool().getAvailableCount());
      */
     
      final CyclicBarrier entree = new CyclicBarrier(2);
      final CyclicBarrier exit = new CyclicBarrier(2);
      Future<Void> future = service.submit(new Callable<Void> () {
         public Void call() throws Exception
         {
            bean.shoo(entree, exit);
            return null;
         }
      });
     
      entree.await(5, SECONDS);
View Full Code Here

   }
  
   @Test
   public void testReentrant() throws Exception
   {
      final NoopLocal bean = lookup("NoopBean/local", NoopLocal.class);
      ExecutorService service = Executors.newSingleThreadExecutor();
      final CyclicBarrier entree = new CyclicBarrier(2);
      final CyclicBarrier exit = new CyclicBarrier(2);
      Future<Void> future = service.submit(new Callable<Void> () {
         public Void call() throws Exception
         {
            bean.reentrant(1, entree, exit);
            return null;
         }
      });
     
      entree.await(5, SECONDS);
View Full Code Here

   }
  
   @Test
   public void testThreeThreads() throws Exception
   {
      final NoopLocal bean = lookup("NoopBean/local", NoopLocal.class);
      ExecutorService service = Executors.newFixedThreadPool(2);
     
      final CyclicBarrier entree = new CyclicBarrier(3);
      final CyclicBarrier exit = new CyclicBarrier(3);
      Callable<Void> task = new Callable<Void> () {
         public Void call() throws Exception
         {
            bean.shoo(entree, exit);
            return null;
         }
      };
      Future<?> futures[] = new Future[2];
      futures[0] = service.submit(task);
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.ejbthree1703.NoopBean

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.