Package com.sun.ejb.containers

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


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


    *
    * @return Context /w instance
    */
   public BeanContext get()
   {
      BeanContext bean = acquire();
      if(bean != null)
         return bean;

      try
      {
View Full Code Here

      return bean;
   }

   public BeanContext get(Class[] initTypes, Object[] initValues)
   {
      BeanContext bean = acquire();
      if(bean != null)
         return bean;
     
      try
      {
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.invokePostConstruct(ctx, initValues);

      // the init method only applies to stateful session beans
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

/*    */   public Object invoke(Invocation invocation) throws Throwable
/*    */   {
/* 52 */     EJBContainerInvocation ejb = (EJBContainerInvocation)invocation;
/* 53 */     EJBContainer container = ejb.getAdvisor();
/* 54 */     Pool pool = container.getPool();
/* 55 */     BeanContext ctx = pool.get();
/* 56 */     ejb.setTargetObject(ctx.getInstance());
/* 57 */     ejb.setBeanContext(ctx);
/* 58 */     container.pushContext(ctx);
/*    */
/* 60 */     boolean discard = false;
/*    */     try
View Full Code Here

/*     */
/* 132 */     synchronized (this.pool)
/*     */     {
/* 134 */       if (!this.pool.isEmpty())
/*     */       {
/* 136 */         BeanContext bean = (BeanContext)this.pool.removeFirst();
/* 137 */         this.inUse += 1;
/* 138 */         return bean;
/*     */       }
/*     */
/*     */     }
View Full Code Here

/*     */
/* 168 */     synchronized (this.pool)
/*     */     {
/* 170 */       if (!this.pool.isEmpty())
/*     */       {
/* 172 */         BeanContext bean = (BeanContext)this.pool.removeFirst();
/* 173 */         this.inUse += 1;
/* 174 */         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.