anvil.database
Interface ConnectionMonitor

All Known Implementing Classes:
ConnectionMonitorImpl, ConnectionPool

public interface ConnectionMonitor

Interface for monitoring events related to connections.

Version:
$Revision: 1.5 $
Author:
Jani Lehtimäki

Method Summary
 void connectionAcquireTimedout(ConnectionPool pool, long duration)
          Notifies unsuccessful attempt to acquire connection.
 void connectionClosed(PooledConnection connection)
          Notifies that connection is being closed, because maximum lifetime has been exceeded or java.sql.Connection instance has been expliticly closed (for instance with java.sql.Connection.close()).
 void connectionCreated(PooledConnection connection, long duration)
          Notifies creation of connection.
 void connectionException(java.lang.String source, java.lang.Exception exception)
          Notifies exception situation.
 void connectionReleased(PooledConnection connection)
          Notifies release of connection immediately after operation has been performed.
 void connectionReserved(PooledConnection connection, long duration)
          Notifies reservation of connection immediately after operation has been performed.
 void connectionTimeout(PooledConnection connection)
          Notifies that the maximum reservation time of connection has been exceed.
 void initialize(ConnectionPool pool)
          Initializes the monitor, called after the manager has been started up.
 

Method Detail

initialize

public void initialize(ConnectionPool pool)
Initializes the monitor, called after the manager has been started up.

Parameters:
pool - Instance of connection pool

connectionCreated

public void connectionCreated(PooledConnection connection,
                              long duration)
Notifies creation of connection. Upon notification connection is considered pending, not yet reserved.

Parameters:
connection - PooledConnection
duration - Duration of operation, in milliseconds

connectionReserved

public void connectionReserved(PooledConnection connection,
                               long duration)
Notifies reservation of connection immediately after operation has been performed.

Parameters:
connection - PooledConnection
duration - Duration of operation, in milliseconds

connectionAcquireTimedout

public void connectionAcquireTimedout(ConnectionPool pool,
                                      long duration)
Notifies unsuccessful attempt to acquire connection. Maximum timeout for acquire operation has been exceed.

Parameters:
pool - ConnectionPool
duration - Duration of operation, in milliseconds

connectionReleased

public void connectionReleased(PooledConnection connection)
Notifies release of connection immediately after operation has been performed.

Parameters:
connection - PooledConnection

connectionClosed

public void connectionClosed(PooledConnection connection)
Notifies that connection is being closed, because maximum lifetime has been exceeded or java.sql.Connection instance has been expliticly closed (for instance with java.sql.Connection.close()).

Parameters:
connection - PooledConnection

connectionTimeout

public void connectionTimeout(PooledConnection connection)
Notifies that the maximum reservation time of connection has been exceed. Thus the reserving thread is considered dead and connection has been a subject to forced shutdown.

Parameters:
connection - PooledConnection

connectionException

public void connectionException(java.lang.String source,
                                java.lang.Exception exception)
Notifies exception situation.

Parameters:
source - Informative source name (class.method)
exception - Exception that occured