Package org.jboss.ejb3

Examples of org.jboss.ejb3.BeanContext


     
      Runnable r = new Runnable()
      {
         public void run()
         {
            BeanContext ctx = pool.get();
            pool.release(ctx);
           
            ctx = null;
            used++;
         }
View Full Code Here


      {
         public void run()
         {
            for(int i = 0; i < 10; i++)
            {
               BeanContext ctx = pool.get();
               pool.release(ctx);
              
               ctx = null;
               used++;
            }
View Full Code Here

    */
   @Test
   public void testDiscard() throws Exception
   {
      logger.info("Getting an bean context from the InfinitePool, currentSize: " + infinitePool.getCurrentSize());
      BeanContext ctx = infinitePool.get();

      logger.info("currentSize: " + infinitePool.getCurrentSize() + " after get()");

      int sizeBeforeDiscard = infinitePool.getCurrentSize();

View Full Code Here

      return create(null, null);
   }

   protected BeanContext<?> create(Class[] initTypes, Object[] initValues)
   {
      BeanContext ctx;
      ctx = createBeanContext();
      container.pushContext(ctx);
      try
      {
         container.injectBeanContext(ctx);

         ctx.initialiseInterceptorInstances();

      }
      finally
      {
         container.popContext();
View Full Code Here

      return create(null, null);
   }
  
   protected BeanContext<?> create(Class[] initTypes, Object[] initValues)
   {
      BeanContext ctx;
      ctx = createBeanContext();
      container.pushContext(ctx);
      try
      {
         container.injectBeanContext(ctx);

         ctx.initialiseInterceptorInstances();

      }
      finally
      {
         container.popContext();
      }
     
      container.invokePostConstruct(ctx, initValues);
     
      //TODO This needs to be reimplemented as replacement for create() on home interface
      container.invokeInit(ctx.getInstance(), initTypes, initValues);
     
      ++createCount;
     
      return ctx;
   }
View Full Code Here

      synchronized (pool)
      {
         if (!pool.isEmpty())
         {
            BeanContext bean = (BeanContext) pool.removeFirst();
            ++inUse;
            return bean;
         }
      }
View Full Code Here

      synchronized (pool)
      {
         if (!pool.isEmpty())
         {
            BeanContext bean = (BeanContext) pool.removeFirst();
            ++inUse;
            return bean;
         }
      }
View Full Code Here

   private void freeAll()
   {
      LinkedList clone = (LinkedList) pool.clone();
      for (int i = 0; i < clone.size(); i++)
      {
         BeanContext bc = (BeanContext) clone.get(i);
         // Clear TX so that still TX entity pools get killed as well
         discard(bc);
      }
      pool.clear();
      inUse = 0;
View Full Code Here

      return create(null, null);
   }

   protected BeanContext<?> create(Class[] initTypes, Object[] initValues)
   {
      BeanContext ctx;
      ctx = createBeanContext();
      container.pushContext(ctx);
      try
      {
         container.injectBeanContext(ctx);

         ctx.initialiseInterceptorInstances();

      }
      finally
      {
         container.popContext();
      }

      container.invokePostConstruct(ctx, initValues);

      //TODO This needs to be reimplemented as replacement for create() on home interface
      container.invokeInit(ctx.getInstance(), initTypes, initValues);

      ++createCount;

      return ctx;
   }
View Full Code Here

      synchronized (pool)
      {
         if (!pool.isEmpty())
         {
            BeanContext bean = (BeanContext) pool.removeFirst();
            ++inUse;
            return bean;
         }
      }
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.BeanContext

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.