toolbox.pooling
Interface ResourcePool

Package class diagram package ResourcePool
All Known Implementing Classes:
JDBCResourcePool, ResourcePoolImpl, SocketResourcePool

public interface ResourcePool

Interface that describes a generic resource pool.


Method Summary
 void destroy()
          Destroy this resource pool.
 java.lang.Object getResource()
          Returns a resource from this pool
 java.lang.String getStatus()
          Return the status of this resource pool.
 void init(java.lang.String name, XMLProperties xmlProps)
          Initialise the resources that the pool implementation will provide here.
 void releaseResource(java.lang.Object resource)
          Release a resource back into the pool.
 

Method Detail

init

void init(java.lang.String name,
          XMLProperties xmlProps)
          throws ResourcePoolException
Initialise the resources that the pool implementation will provide here.

Parameters:
name - Unique name for this pool.
xmlProps - XML configuration properties.
Throws:
ResourcePoolException - if the pool cannot be initialised.

getResource

java.lang.Object getResource()
                             throws ResourcePoolException
Returns a resource from this pool

Returns:
Object reference to resource.
Throws:
ResourcePoolException - if a resource could not be returned from the pool.

releaseResource

void releaseResource(java.lang.Object resource)
Release a resource back into the pool.

Parameters:
resource - Object being released to the pool.

getStatus

java.lang.String getStatus()
Return the status of this resource pool.

Returns:
String containing the current status of the pool.

destroy

void destroy()
             throws ResourcePoolException
Destroy this resource pool.

Throws:
ResourcePoolException - if this pool cannot be destroyed.