User: simone
Date: 00/12/27 10:31:46
Modified: src/main/org/jboss/ejb/plugins AbstractInstancePool.java
Log:
Removed old synchronization code.
Revision Changes Path
1.9 +25 -28 jboss/src/main/org/jboss/ejb/plugins/AbstractInstancePool.java
Index: AbstractInstancePool.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/AbstractInstancePool.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- AbstractInstancePool.java 2000/12/07 15:44:23 1.8
+++ AbstractInstancePool.java 2000/12/27 18:31:45 1.9
@@ -27,40 +27,40 @@
/**
- * <description>
- *
+ * <description>
+ *
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.9 $
*/
public abstract class AbstractInstancePool
implements InstancePool, XmlLoadable
{
// Constants -----------------------------------------------------
-
+
// Attributes ----------------------------------------------------
private Container container;
-
+
Stack pool = new Stack();
int maxSize = 30;
-
+
// Static --------------------------------------------------------
-
+
// Constructors --------------------------------------------------
-
+
// Public --------------------------------------------------------
/**
* Set the callback to the container. This is for initialization.
* The IM may extract the configuration from the container.
*
- * @param c
+ * @param c
*/
public void setContainer(Container c)
{
this.container = c;
}
-
+
public Container getContainer()
{
return container;
@@ -70,12 +70,12 @@
throws Exception
{
}
-
+
public void start()
throws Exception
{
}
-
+
public void stop()
{
}
@@ -83,19 +83,19 @@
public void destroy()
{
}
-
+
/**
* Get an instance without identity.
* Can be used by finders,create-methods, and activation
*
* @return Context /w instance
- * @exception RemoteException
+ * @exception RemoteException
*/
public synchronized EnterpriseContext get()
throws Exception
{
//DEBUG Logger.debug("Get instance "+this);
-
+
if (!pool.empty())
{
return (EnterpriseContext)pool.pop();
@@ -113,7 +113,7 @@
}
}
}
-
+
/**
* Return an instance after invocation.
*
@@ -121,18 +121,15 @@
* a) Done with finder method
* b) Just removed
*
- * @param ctx
+ * @param ctx
*/
public synchronized void free(EnterpriseContext ctx)
{
// Pool it
//DEBUG Logger.debug("Free instance:"+ctx.getId()+"#"+ctx.getTransaction());
-
+
ctx.clear();
-
- // Free everyone waiting on that ctx
- synchronized (ctx) {ctx.notifyAll();}
-
+
if (pool.size() < maxSize)
{
pool.push(ctx);
@@ -141,7 +138,7 @@
discard(ctx);
}
}
-
+
public void discard(EnterpriseContext ctx)
{
// Throw away
@@ -153,9 +150,9 @@
// DEBUG Logger.exception(e);
}
}
-
+
// Z implementation ----------------------------------------------
-
+
// XmlLoadable implementation
public void importXml(Element element) throws DeploymentException {
String maximumSize =
MetaData.getElementContent(MetaData.getUniqueChild(element, "MaximumSize"));
@@ -165,13 +162,13 @@
throw new DeploymentException("Invalid MaximumSize value for instance pool
configuration");
}
}
-
+
// Package protected ---------------------------------------------
-
+
// Protected -----------------------------------------------------
protected abstract EnterpriseContext create(Object instance)
throws Exception;
-
+
// Private -------------------------------------------------------
// Inner classes -------------------------------------------------