Package org.jboss.ejb3

Examples of org.jboss.ejb3.BeanContext


   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

/*     */   private void freeAll()
/*     */   {
/* 267 */     LinkedList clone = (LinkedList)this.pool.clone();
/* 268 */     for (int i = 0; i < clone.size(); i++)
/*     */     {
/* 270 */       BeanContext bc = (BeanContext)clone.get(i);
/*     */
/* 272 */       discard(bc);
/*     */     }
/* 274 */     this.pool.clear();
/* 275 */     this.inUse = 0;
View Full Code Here

/*  73 */     return create(null, null);
/*     */   }
/*     */
/*     */   protected BeanContext<?> create(Class[] initTypes, Object[] initValues)
/*     */   {
/*  79 */     BeanContext ctx = createBeanContext();
/*     */
/*  93 */     this.container.pushContext(ctx);
/*     */     try
/*     */     {
/*  96 */       if (this.injectors != null)
/*     */       {
/*  98 */         for (int i = 0; i < this.injectors.length; i++)
/*     */         {
/* 100 */           this.injectors[i].inject(ctx);
/*     */         }
/*     */       }
/*     */
/* 104 */       ctx.initialiseInterceptorInstances();
/*     */     }
/*     */     finally
/*     */     {
/* 109 */       this.container.popContext();
/*     */     }
/*     */
/* 118 */     this.container.invokePostConstruct(ctx, initValues);
/*     */
/* 121 */     this.container.invokeInit(ctx.getInstance(), initTypes, initValues);
/*     */
/* 123 */     this.createCount += 1;
/*     */
/* 125 */     return ctx;
/*     */   }
View Full Code Here

/*  76 */     this.inUse = 0;
/*     */   }
/*     */
/*     */   public BeanContext get()
/*     */   {
/*  81 */     BeanContext ctx = null;
/*     */
/*  83 */     synchronized (this.pool)
/*     */     {
/*  85 */       ctx = (BeanContext)this.currentBeanContext.get();
/*  86 */       if (ctx != null)
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.