com.atomikos.datasource.pool
Class ConnectionPool
java.lang.Object
com.atomikos.datasource.pool.ConnectionPool
- All Implemented Interfaces:
- XPooledConnectionEventListener
public class ConnectionPool
- extends Object
- implements XPooledConnectionEventListener
DEFAULT_MAINTENANCE_INTERVAL
public static final int DEFAULT_MAINTENANCE_INTERVAL
- See Also:
- Constant Field Values
ConnectionPool
public ConnectionPool(ConnectionFactory connectionFactory,
ConnectionPoolProperties properties)
throws ConnectionPoolException
- Throws:
ConnectionPoolException
borrowConnection
public Reapable borrowConnection(HeuristicMessage hmsg)
throws CreateConnectionException,
PoolExhaustedException,
ConnectionPoolException
- Borrows a connection from the pool.
- Parameters:
hmsg
- The heuristic message to get the connection with.
- Returns:
- The connection as Reapable.
- Throws:
CreateConnectionException
- If the pool attempted to grow but failed.
PoolExhaustedException
- If the pool could not grow because it is exhaused.
ConnectionPoolException
- Other errors.
destroy
public void destroy()
availableSize
public int availableSize()
- The amount of pooled connections in state available.
- Returns:
- the amount of pooled connections in state available.
totalSize
public int totalSize()
- The total amount of pooled connections in any state.
- Returns:
- the total amount of pooled connections in any state
onXPooledConnectionTerminated
public void onXPooledConnectionTerminated(XPooledConnection connection)
- Description copied from interface:
XPooledConnectionEventListener
- fired when a connection changed its state to terminated
- Specified by:
onXPooledConnectionTerminated
in interface XPooledConnectionEventListener
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2011. All Rights Reserved.