[jboss-cvs] JBossAS SVN: r91833 - branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jul 30 11:13:25 EDT 2009
Author: wolfc
Date: 2009-07-30 11:13:25 -0400 (Thu, 30 Jul 2009)
New Revision: 91833
Modified:
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/ThreadlocalPool.java
Log:
JBPAPP-1662: dynamic maxSize on ThreadlocalPool (merged 91831)
Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/ThreadlocalPool.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/ThreadlocalPool.java 2009-07-30 14:25:20 UTC (rev 91832)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/ThreadlocalPool.java 2009-07-30 15:13:25 UTC (rev 91833)
@@ -39,7 +39,6 @@
protected Pool pool = new InfinitePool();
protected WeakThreadLocal<BeanContext> currentBeanContext = new WeakThreadLocal<BeanContext>();
private int inUse = 0;
- private int maxSize = 30;
public ThreadlocalPool()
{
@@ -117,7 +116,6 @@
public void initialize(Container container, Class contextClass, Class beanClass, int maxSize, long timeout)
{
pool.initialize(container, contextClass, beanClass, maxSize, timeout);
- this.maxSize = maxSize;
}
public void release(BeanContext ctx)
@@ -154,7 +152,7 @@
public int getAvailableCount()
{
- return maxSize - inUse;
+ return getMaxSize() - inUse;
}
public int getCreateCount()
@@ -164,7 +162,9 @@
public int getMaxSize()
{
- return maxSize;
+ // the thread local pool dynamically grows for new threads
+ // if a bean is reentrant it'll grow and shrink over the reentrant call
+ return getCurrentSize();
}
public int getRemoveCount()
@@ -179,6 +179,7 @@
public void setMaxSize(int maxSize)
{
- this.maxSize = maxSize;
+ //this.maxSize = maxSize;
+ log.warn("EJBTHREE-1703: setting a max size on ThreadlocalPool is bogus");
}
}
More information about the jboss-cvs-commits
mailing list