PooliT :: Design
PooliT has a very simple core API consisting of two interfaces:
Pooler and PoolHandler.
The core API is found in the org.ascentphase.poolit
package.
The Pooler interface defines methods to retrieve and return
objects to a pool. It is left to classes implementing this interface to
establish the pooling algorithm to be used. Several Poolers are
provided with PooliT that offer simple pooling strategies -- like
FixedPooler that stores objects in an array -- to more complex
strategies, such as TimeoutPooler that will clean up objects which
have not been used for an extended period of time. Poolers
provided with PooliT can be found in the
org.ascentphase.poolit.poolers package. Please view the javadoc to
see other Poolers provided with PooliT. Poolers
should not be tied to a particular class to be pooled. Poolers
are meant to be able to pool any type of object, and should only be concerned
about the pooling algorithm.
The PoolHandler interface defines methods to create, destroy and
check the integrity of objects that are being pooled. Poolers
call upon the PoolHandler to perform the three actions specified
as the handlers contain the logic to perform these operations for a particular
class. Several PoolHandlers are packaged with PooliT and can be
found in the org.ascentphase.poolit.handlers package. Some
examples of classes that have handlers provided by PooliT:
java.net.Socket
java.sql.Connection
javax.naming.InitialContext