All Packages Class Hierarchy This Package Previous Next Index
Class org.xmlmiddleware.utils.Pool
java.lang.Object
|
+----org.xmlmiddleware.utils.Pool
- public abstract class Pool
- extends Object
Implements a simple object pool.
This is an abstract class that other classes extend to get pooling
functionality. Subclasses implement createObject and closeObject
to create and close objects that use the pool.
The pool has explicit check-out and check-in methods. However,
the calling application never knows if new objects are allocated
during the check-out procedure.
- Version:
- 2.0
- Author:
- Sean Walter, 2001, Ronald Bourret, 2001
-
Pool()
-
Construct a new Pool object.
-
checkIn(Object)
- Check an Object back into the pool.
-
checkOut(Object)
- Check an Object with the specified ID out of the pool.
-
finalize()
-
Closes all objects under control of the pool, regardless of whether
they are checked in or out.
Pool
public Pool()
- Construct a new Pool object.
finalize
public void finalize()
- Closes all objects under control of the pool, regardless of whether
they are checked in or out.
- Overrides:
- finalize in class Object
checkOut
public Object checkOut(Object id) throws XMLMiddlewareException
- Check an Object with the specified ID out of the pool.
The object is not available to other processes until it has been checked
back in. Note that the pool can contain more than one object that has the
same ID. For example, when used to pool connections, this allows the pool to
contain more than one connection to the same databases.
- Returns:
- The object.
- Throws: XMLMiddlewareException
- Thrown if the pool does not recognize the ID or cannot
return the specified object for any reason, such as lack
of resources.
checkIn
public void checkIn(Object object) throws XMLMiddlewareException
- Check an Object back into the pool.
- Parameters:
- object - The object.
- Throws: XMLMiddlewareException
- Thrown if the object does not belong to this pool.
All Packages Class Hierarchy This Package Previous Next Index