[jboss-cvs] JBossAS SVN: r78777 - trunk/server/src/main/org/jboss/ejb/plugins.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Sep 23 04:23:07 EDT 2008


Author: emuckenhuber
Date: 2008-09-23 04:23:06 -0400 (Tue, 23 Sep 2008)
New Revision: 78777

Modified:
   trunk/server/src/main/org/jboss/ejb/plugins/AbstractInstancePool.java
Log:
[JBAS-5332] (re)create strict-pool

Modified: trunk/server/src/main/org/jboss/ejb/plugins/AbstractInstancePool.java
===================================================================
--- trunk/server/src/main/org/jboss/ejb/plugins/AbstractInstancePool.java	2008-09-23 08:18:04 UTC (rev 78776)
+++ trunk/server/src/main/org/jboss/ejb/plugins/AbstractInstancePool.java	2008-09-23 08:23:06 UTC (rev 78777)
@@ -21,22 +21,22 @@
 */
 package org.jboss.ejb.plugins;
 
+import java.lang.reflect.UndeclaredThrowableException;
 import java.rmi.RemoteException;
 import java.util.LinkedList;
-import java.lang.reflect.UndeclaredThrowableException;
+
+import javax.ejb.CreateException;
 import javax.ejb.EJBException;
-import javax.ejb.CreateException;
 
+import org.jboss.deployment.DeploymentException;
 import org.jboss.ejb.Container;
+import org.jboss.ejb.EnterpriseContext;
 import org.jboss.ejb.InstancePool;
-import org.jboss.ejb.EnterpriseContext;
-
-import org.jboss.deployment.DeploymentException;
 import org.jboss.metadata.MetaData;
 import org.jboss.metadata.XmlLoadable;
 import org.jboss.system.ServiceMBeanSupport;
+import org.w3c.dom.Element;
 
-import org.w3c.dom.Element;
 import EDU.oswego.cs.dl.util.concurrent.FIFOSemaphore;
 
 /**
@@ -76,6 +76,8 @@
    protected int maxSize = 30;
    /** determine if we reuse EnterpriseContext objects i.e. if we actually do pooling */
    protected boolean reclaim = false;
+   /** Will the pool block when MaximumSize instances are active */
+   protected Boolean isStrict = Boolean.FALSE;
 
 
    // Static --------------------------------------------------------
@@ -310,9 +312,8 @@
 
       // Get whether the pool will block when MaximumSize instances are active
       String strictValue = MetaData.getElementContent(MetaData.getOptionalChild(element, "strictMaximumSize"));
-      Boolean strictFlag = Boolean.valueOf(strictValue);
-      if( strictFlag == Boolean.TRUE )
-         this.strictMaxSize = new FIFOSemaphore(this.maxSize);
+      this.isStrict = Boolean.valueOf(strictValue);
+      
       String delay = MetaData.getElementContent(MetaData.getOptionalChild(element, "strictTimeout"));
       try
       {
@@ -331,10 +332,16 @@
    protected abstract EnterpriseContext create(Object instance)
    throws Exception;
 
+   protected void createService() throws Exception
+   {
+      if( this.isStrict == Boolean.TRUE )
+         this.strictMaxSize = new FIFOSemaphore(this.maxSize);
+   }
+   
    protected void destroyService() throws Exception
    {
      freeAll();
-     this.container = null;
+     this.strictMaxSize = null;
    }
 
    // Private -------------------------------------------------------




More information about the jboss-cvs-commits mailing list