org.jwarp.service.connectionpool
Interface IConnectionPoolService
- All Superinterfaces:
- IConfigurable, IExceptionProvider, IService
- public interface IConnectionPoolService
- extends IService
Interface for the connection-pool service
- Version:
- 1.0
- Author:
- Anatole Tresch
|
Field Summary |
static java.lang.String |
SERVICE_TYPE
Service type string constant |
| Methods inherited from interface org.jwarp.service.IService |
checkContext, getDependencies, getLogLevel, getName, getStatus, getType, resume, setContext, setDependencies, setLogLevel, shutdown, start, suspend |
SERVICE_TYPE
public static final java.lang.String SERVICE_TYPE
- Service type string constant
addPool
public void addPool(ConnectionPool pool,
ITicket user)
throws java.lang.SecurityException
- Ad a new pool to the service.
- Parameters:
A - new connection pooluser - The user- Throws:
java.lang.SecurityException - If access to this pool was denied.
removePool
public void removePool(java.lang.String poolName,
ITicket user)
throws InvalidPoolException,
java.lang.SecurityException
- Remove the pool with the given name.
- Parameters:
name - The pools nameuser - The user- Throws:
InvalidPoolException - If the requested pool could not be located.java.lang.SecurityException - If access to this pool was denied.
getPool
public ConnectionPool getPool(java.lang.String name,
ITicket user)
throws InvalidPoolException,
java.lang.SecurityException
- Get the pool named name
- Parameters:
name - The pools name- Returns:
- the pool or null if the pool does not exist.
- Throws:
InvalidPoolException - If the requested pool could not be located.java.lang.SecurityException - If access to this pool was denied.
getPoolNames
public java.lang.String[] getPoolNames()
throws java.lang.SecurityException
- Get a list of names of all managed pools
- Returns:
- An enumeration of all defined pools.
getDrivers
public java.lang.String[] getDrivers()
- Get the actual loaded drivers
getConnection
public java.sql.Connection getConnection(java.lang.String poolName,
ITicket user)
throws InvalidPoolException,
MaxConnectException,
java.lang.SecurityException
- Get a connection from the given pool.
- Parameters:
The - pool name.- Returns:
- A database connection.
- Throws:
InvalidPoolException - if the specified pool can not be foundMaxConnectException - if all connections are checked outjava.lang.SecurityException - If access to this pool was denied.
checkFreeConnections
public void checkFreeConnections()
- Checkes for too many free connections. If there are too many some connections will be closed
and removed from the pool. Called by ConnectionPoolUpdateThread.
- See Also:
ConnectionPoolUpdateThread
release
public void release(ITicket ticket)
throws java.lang.SecurityException
- Tries to tell all pools managed by this manager to release all connections.
- Throws:
java.lang.SecurityException - If access to this pool was denied.