Package org.apache.openejb.config.sys

Examples of org.apache.openejb.config.sys.SaxAppCtxConfig$SaxAppContextConfig$BeanContext


/*  97 */     return ctx;
/*     */   }
/*     */
/*     */   public BeanContext get(Class[] initTypes, Object[] initValues)
/*     */   {
/* 102 */     BeanContext ctx = null;
/* 103 */     synchronized (this.pool)
/*     */     {
/* 105 */       ctx = (BeanContext)this.currentBeanContext.get();
/* 106 */       if (ctx != null)
/*     */       {
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

     
      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

      {
         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

      inUse.getAndSet(0);
   }
  
   public BeanContext get()
   {
      BeanContext ctx = currentBeanContext.get();
      if (ctx != null)
         currentBeanContext.set(null);
      else
         ctx = create();
View Full Code Here

      return ctx;
   }

   public BeanContext get(Class[] initTypes, Object[] initValues)
   {
      BeanContext ctx = currentBeanContext.get();
      if (ctx != null)
         currentBeanContext.set(null);
      else
         ctx = create(initTypes, initValues);
View Full Code Here

      return create(null, null);
   }
  
   protected BeanContext<?> create(Class[] initTypes, Object[] initValues)
   {
      BeanContext ctx;
      ctx = createBeanContext();
      if (ctx instanceof StatefulBeanContext)
      {        
         StatefulBeanContext sfctx = (StatefulBeanContext) ctx;
         // FIXME: remove this class cast
         EJBContainer c = (EJBContainer) container;
         // Tell context how to handle replication
         CacheConfig config = c.getAnnotation(CacheConfig.class);
         if (config != null)
         {
            sfctx.setReplicationIsPassivation(config.replicationIsPassivation());
         }
         // this is for propagated extended PC's
         ctx = sfctx = sfctx.pushContainedIn();
      }
      container.pushContext(ctx);
      try
      {
         if (injectors != null)
         {
            for (int i = 0; i < injectors.length; i++)
            {
               injectors[i].inject(ctx);
            }
         }

         ctx.initialiseInterceptorInstances();

      }
      finally
      {
         container.popContext();
         if (ctx instanceof StatefulBeanContext)
         {
            // this is for propagated extended PC's
            StatefulBeanContext sfctx = (StatefulBeanContext) ctx;
            sfctx.popContainedIn();
         }
      }
     
      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

TOP

Related Classes of org.apache.openejb.config.sys.SaxAppCtxConfig$SaxAppContextConfig$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.