FileDocCategorySizeDatePackage
ThreadlocalPool.javaAPI DocJBoss 4.2.12556Fri Jul 13 20:53:58 BST 2007org.jboss.ejb3

ThreadlocalPool

public class ThreadlocalPool extends AbstractPool
Pools EJBs within a ThreadLocal.
author
Bill Burke
version
$Revision: 61280 $

Fields Summary
private static final Logger
log
protected org.jboss.lang.ref.WeakThreadLocal
pool
Constructors Summary
public ThreadlocalPool()


    
   
   
Methods Summary
public voiddestroy()

      log.trace("destroying pool");
      
      // This really serves little purpose, because we want the whole thread local map to die
      pool.remove();
   
public BeanContextget()

      BeanContext ctx = pool.get();
      if (ctx != null)
      {
         pool.set(null);
         return ctx;
      }

      ctx = create();
      return ctx;
   
public BeanContextget(java.lang.Class[] initTypes, java.lang.Object[] initValues)

      BeanContext ctx = pool.get();
      if (ctx != null)
      {
         pool.set(null);
         return ctx;
      }

      ctx = create(initTypes, initValues);
      return ctx;
   
public intgetAvailableCount()

	   return -1;
   
public intgetCurrentSize()

	   return -1;
   
public intgetMaxSize()

	   return -1;
   
public voidrelease(BeanContext ctx)

      if (pool.get() != null)
         remove(ctx);
      else
         pool.set(ctx);
   
public voidsetMaxSize(int maxSize)