All Packages Class Hierarchy This Package Previous Next Index
Class org.xmlmiddleware.db.ConnectionPool
java.lang.Object
|
+----org.xmlmiddleware.utils.Pool
|
+----org.xmlmiddleware.db.ConnectionPool
- public abstract class ConnectionPool
- extends Pool
- implements CPConnectionEventListener
Implements a connection pool.
This class is abstract. Classes that need connection pooling
extend this class and implement the createObject and removeObject
methods from Pool.
- Version:
- 2.0
- Author:
- Sean Walter, 2001, Ronald Bourret, 2001
-
ConnectionPool()
- Create a new ConnectionPool object.
-
checkIn(Object)
- Check a connection back into the pool.
-
checkOut(Object)
- Check a connection with the specified ID out of the pool.
-
connectionClosed(CPConnectionEvent)
- When a CPConnection is closed, checks the underlying connection back
in to the pool.
-
connectionErrorOccurred(CPConnectionEvent)
- When an error occurs on a CPConnection, removes it from the pool.
ConnectionPool
public ConnectionPool()
- Create a new ConnectionPool object.
checkOut
public Object checkOut(Object id) throws XMLMiddlewareException
- Check a connection with the specified ID out of the pool.
Overrides Pool.checkOut(Object).
- 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.
- Overrides:
- checkOut in class Pool
checkIn
public void checkIn(Object object) throws XMLMiddlewareException
- Check a connection back into the pool.
Overrides Pool.checkIn(Object).
- Parameters:
- object - The object.
- Throws: XMLMiddlewareException
- Thrown if the object does not belong to this pool.
- Overrides:
- checkIn in class Pool
connectionClosed
public void connectionClosed(CPConnectionEvent event)
- When a CPConnection is closed, checks the underlying connection back
in to the pool.
- Parameters:
- CPConnectionEvent - object containing the connection.
connectionErrorOccurred
public void connectionErrorOccurred(CPConnectionEvent event)
- When an error occurs on a CPConnection, removes it from the pool.
Removing a connection from the pool in the case of an error is
admittedly drastic, but there is no way to tell if the error was
fatal to the connection or not.
- Parameters:
- CPConnectionEvent - object containing the connection.
All Packages Class Hierarchy This Package Previous Next Index