Package com.sun.ejb.containers

Examples of com.sun.ejb.containers.BaseContainer$BeanContext


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


      ThreadlocalPool pool = new ThreadlocalPool();
      Container container = new MockContainer();
      int maxSize = -1;
      int timeout = -1;
      pool.initialize(container, maxSize, timeout);
      BeanContext ctx = pool.get();
      pool.release(ctx);
     
      ctx = null;
     
      gc();
View Full Code Here

      int timeout = -1;
      pool.initialize(container, maxSize, timeout);

      assertEquals(0, pool.getAvailableCount());
     
      BeanContext ctx = pool.get();

      assertEquals(0, pool.getAvailableCount());

      pool.release(ctx);
      ctx = null;
View Full Code Here

     
      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

TOP

Related Classes of com.sun.ejb.containers.BaseContainer$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.