org.logicalcobwebs.proxool
Class HouseKeeperTest.Listener

java.lang.Object
  extended by org.logicalcobwebs.proxool.HouseKeeperTest.Listener
All Implemented Interfaces:
ConnectionListenerIF
Enclosing class:
HouseKeeperTest

 class HouseKeeperTest.Listener
extends java.lang.Object
implements ConnectionListenerIF


Field Summary
(package private)  boolean called
           
 
Fields inherited from interface org.logicalcobwebs.proxool.ConnectionListenerIF
FATAL_SQL_EXCEPTION_DETECTED, HOUSE_KEEPER_TEST_FAIL, MANUAL_EXPIRY, MAXIMUM_ACTIVE_TIME_EXPIRED, MAXIMUM_CONNECTION_LIFETIME_EXCEEDED, RESET_FAIL, SHUTDOWN, VALIDATION_FAIL
 
Constructor Summary
HouseKeeperTest.Listener()
           
 
Method Summary
 void onBirth(java.sql.Connection connection)
          Happens everytime we create a new connection.
 void onDeath(java.sql.Connection connection, int reasonCode)
          Happens just before we expire a connection.
 void onExecute(java.lang.String command, long elapsedTime)
          Happens after every successful execute.
 void onFail(java.lang.String command, java.lang.Exception exception)
          Happens everytime an exception was thrown during an execute method Note that the command is not fully implemented at this stage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

called

boolean called
Constructor Detail

HouseKeeperTest.Listener

HouseKeeperTest.Listener()
Method Detail

onBirth

public void onBirth(java.sql.Connection connection)
             throws java.sql.SQLException
Description copied from interface: ConnectionListenerIF
Happens everytime we create a new connection. You can use this to allocate resources to a connection that might be useful during the lifetime of the connection.

Specified by:
onBirth in interface ConnectionListenerIF
Parameters:
connection - the connection that has just been created
Throws:
java.sql.SQLException - if anything goes wrong (which will then be logged but ignored)

onDeath

public void onDeath(java.sql.Connection connection,
                    int reasonCode)
             throws java.sql.SQLException
Description copied from interface: ConnectionListenerIF
Happens just before we expire a connection. You can use this to reclaim resources from a connection.

Specified by:
onDeath in interface ConnectionListenerIF
Parameters:
connection - the connection that is about to expire
reasonCode - ConnectionListenerIF.MAXIMUM_ACTIVE_TIME_EXPIRED, ConnectionListenerIF.HOUSE_KEEPER_TEST_FAIL, ConnectionListenerIF.FATAL_SQL_EXCEPTION_DETECTED, ConnectionListenerIF.MANUAL_EXPIRY, ConnectionListenerIF.MAXIMUM_CONNECTION_LIFETIME_EXCEEDED, ConnectionListenerIF.RESET_FAIL, ConnectionListenerIF.SHUTDOWN, or ConnectionListenerIF.VALIDATION_FAIL
Throws:
java.sql.SQLException - if anything goes wrong (which will then be logged but ignored)

onExecute

public void onExecute(java.lang.String command,
                      long elapsedTime)
Description copied from interface: ConnectionListenerIF
Happens after every successful execute. Note that the command is not fully implemented at this stage. At some point it might represent the SQL that is sent to the database (or the procedure call that was used).

Specified by:
onExecute in interface ConnectionListenerIF
Parameters:
command - what command was being executed
elapsedTime - how long the call took (in milliseconds)

onFail

public void onFail(java.lang.String command,
                   java.lang.Exception exception)
Description copied from interface: ConnectionListenerIF
Happens everytime an exception was thrown during an execute method Note that the command is not fully implemented at this stage. At some point it might represent the SQL that is sent to the database (or the procedure call that was used).

Specified by:
onFail in interface ConnectionListenerIF
Parameters:
command - what command was being executed
exception - what exception was thrown