Package org.apache.axis.transport.jms
Class JMSConnectorManager.ShareableObjectPool
java.lang.Object
org.apache.axis.transport.jms.JMSConnectorManager.ShareableObjectPool
- Enclosing class:
JMSConnectorManager
A simple non-blocking pool impl for objects that can be shared.
Only a ref count is necessary to prevent collisions at shutdown.
Todo: max size, cleanup stale connections
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Wrapper to track the use count of an object -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the object to the pool, if not already addedvoid
Decrements the connector's reference countvoid
removeObject
(Object obj) void
removeObject
(Object obj, long waitTime) Removes the object from the pool.void
Marks the connector as in use by incrementing the connector's reference countint
size()
-
Constructor Details
-
ShareableObjectPool
public ShareableObjectPool()
-
-
Method Details
-
addObject
Adds the object to the pool, if not already added -
removeObject
Removes the object from the pool. If the object is reserved, waits the specified time before forcibly removing Todo: check expirations with the next request instead of holding up the current request -
removeObject
-
reserve
Marks the connector as in use by incrementing the connector's reference count- Throws:
Exception
-
release
Decrements the connector's reference count -
getElements
-
size
public int size()
-