org.firebirdsql.pool
Class AbstractConnectionPool
java.lang.Object
org.firebirdsql.pool.AbstractConnectionPool
- PooledObjectListener
public abstract class AbstractConnectionPool
extends java.lang.Object
AbstractConnectionPool
protected AbstractConnectionPool()
Create instance of this class.
finalize
protected void finalize()
throws Throwable
Shutdown pool if object is garbage collected.
getFreeSize
public abstract int getFreeSize()
throws SQLException
Get number of free connections in this pool. This method returns the
number of free open connections to the specified database. It might
return 0, but this does not mean that next request will block. This
will happen only if
getMaxSize() != 0 && getMaxSize() == getWorkingSize()
,
meaning that we have allocated maximum number of connections and all
of them are in use.
- number of free connections left.
getLogger
protected abstract org.firebirdsql.logging.Logger getLogger()
Get logger for this instance. By default all log messages belong to
this class. Subclasses can override this behavior.
getPoolName
protected abstract String getPoolName()
Get name of the pool. This name will be displayed in log when pool
is started.
- name of the connection queue.
getPooledConnection
protected PooledObject getPooledConnection(org.firebirdsql.pool.PooledConnectionQueue queue)
throws SQLException
Get pooled connection. This method will block until there will be
free connection to return.
queue
- instance of PooledConnectionQueue
where connection
will be obtained.
getQueue
public org.firebirdsql.pool.PooledConnectionQueue getQueue(Object key)
throws SQLException
Get queue for the specified user name and password.
key
- key identifying pool.
- instance of
PooledConnectionQueue
.
getTotalSize
public abstract int getTotalSize()
throws SQLException
Get total size of physical connections opened to the database.
- total number of opened connections to the database.
getWorkingSize
public abstract int getWorkingSize()
throws SQLException
Get number of connections that are in use.
- number of working connections.
physicalConnectionDeallocated
protected void physicalConnectionDeallocated(PooledObjectEvent event)
Notify about the deallocation of the physical connection (for example,
when connection is removed by the idle remover thread).
restart
public void restart()
Restart this JDBC pool. This method restarts all JDBC connections.
shutdown
public void shutdown()
Shutdown this JDBC pool. This method closes all JDBC connections
and marks pool as shut down.
Copyright B) 2001 David Jencks and other authors. All rights reserved.