|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.firebirdsql.pool.AbstractConnectionPool
public abstract class AbstractConnectionPool
Abstract class for creating connection pools. Subclasses must implement
factory method to produce physical connections to the database (method
getConnectionManager() and few utility methods (getLogger()
and getPoolName()).
| Nested Class Summary | |
|---|---|
protected static class |
AbstractConnectionPool.UserPasswordPair
Structure class to store user name and password. |
| Constructor Summary | |
|---|---|
protected |
AbstractConnectionPool()
Create instance of this class. |
| Method Summary | |
|---|---|
protected void |
finalize()
Shutdown pool if object is garbage collected. |
abstract ConnectionPoolConfiguration |
getConfiguration()
Get configuration of this data source. |
protected abstract PooledConnectionManager |
getConnectionManager()
Get instance of PooledConnectionManager responsible for
instantiating pooled connections. |
abstract int |
getFreeSize()
Get number of free connections in this pool. |
protected abstract Logger |
getLogger()
Get logger for this instance. |
protected PooledObject |
getPooledConnection(org.firebirdsql.pool.PooledConnectionQueue queue)
Get pooled connection. |
protected abstract String |
getPoolName()
Get name of the pool. |
org.firebirdsql.pool.PooledConnectionQueue |
getQueue(Object key)
Get queue for the specified user name and password. |
abstract int |
getTotalSize()
Get total size of physical connections opened to the database. |
abstract int |
getWorkingSize()
Get number of connections that are in use. |
protected void |
physicalConnectionDeallocated(PooledObjectEvent event)
Notify about the deallocation of the physical connection (for example, when connection is removed by the idle remover thread). |
void |
pooledObjectReleased(PooledObjectEvent event)
Notify about new available connection. |
void |
restart()
Restart this JDBC pool. |
void |
shutdown()
Shutdown this JDBC pool. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractConnectionPool()
| Method Detail |
|---|
protected abstract Logger getLogger()
Logger.
protected void finalize()
throws Throwable
finalize in class ObjectThrowable - if something bad happened.public void restart()
public void shutdown()
public org.firebirdsql.pool.PooledConnectionQueue getQueue(Object key)
throws SQLException
key - key identifying pool.
PooledConnectionQueue.
SQLException - if something went wrong.
protected PooledObject getPooledConnection(org.firebirdsql.pool.PooledConnectionQueue queue)
throws SQLException
queue - instance of PooledConnectionQueue where connection
will be obtained.
PooledObject.
SQLException - if pooled connection cannot be obtained.public void pooledObjectReleased(PooledObjectEvent event)
PooledConnection when its wrapped connection being closed.
pooledObjectReleased in interface PooledObjectListenerevent - instance of PooledObjectEvent containing
information about closed connection.protected void physicalConnectionDeallocated(PooledObjectEvent event)
event - instance of PooledObjectEvent.public abstract ConnectionPoolConfiguration getConfiguration()
ConnectionPoolConfiguration describing
this data source.
protected abstract PooledConnectionManager getConnectionManager()
throws SQLException
PooledConnectionManager responsible for
instantiating pooled connections.
PooledConnectionManager
SQLException - if connection manager cannot be obtained.protected abstract String getPoolName()
public abstract int getFreeSize()
throws SQLException
getMaxSize() != 0 && getMaxSize() == getWorkingSize(),
meaning that we have allocated maximum number of connections and all
of them are in use.
SQLException
public abstract int getTotalSize()
throws SQLException
SQLException
public abstract int getWorkingSize()
throws SQLException
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||