org.logicalcobwebs.proxool
Class ConnectionListenerTest.TestConnectionListener

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

 class ConnectionListenerTest.TestConnectionListener
extends java.lang.Object
implements ConnectionListenerIF


Field Summary
(package private)  java.lang.String command
           
 
Constructor Summary
ConnectionListenerTest.TestConnectionListener()
           
 
Method Summary
 void clear()
           
 java.lang.String getCommand()
           
 void onBirth(java.sql.Connection connection)
          Happens everytime we create a new connection.
 void onDeath(java.sql.Connection connection)
          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

command

java.lang.String command
Constructor Detail

ConnectionListenerTest.TestConnectionListener

ConnectionListenerTest.TestConnectionListener()
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)
             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
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

getCommand

public java.lang.String getCommand()

clear

public void clear()