|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.logicalcobwebs.proxool.util.AbstractListenerContainer org.logicalcobwebs.proxool.CompositeConnectionListener
public class CompositeConnectionListener
A ConnectionListenerIF
that keeps a list of ConnectionListenerIF
s
and notifies them in a thread safe manner.
It also implements ListenerContainerIF
which provides methods for
adding
and
removing
listeners.
Constructor Summary | |
---|---|
CompositeConnectionListener()
|
Method Summary | |
---|---|
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 org.logicalcobwebs.proxool.util.AbstractListenerContainer |
---|
addListener, isEmpty, removeListener |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompositeConnectionListener()
Method Detail |
---|
public void onBirth(java.sql.Connection connection) throws java.sql.SQLException
ConnectionListenerIF
onBirth
in interface ConnectionListenerIF
connection
- the connection that has just been created
java.sql.SQLException
- if anything goes wrong (which will then be logged but ignored)ConnectionListenerIF.onBirth(Connection)
public void onDeath(java.sql.Connection connection) throws java.sql.SQLException
ConnectionListenerIF
onDeath
in interface ConnectionListenerIF
connection
- the connection that is about to expire
java.sql.SQLException
- if anything goes wrong (which will then be logged but ignored)ConnectionListenerIF.onDeath(Connection)
public void onExecute(java.lang.String command, long elapsedTime)
ConnectionListenerIF
onExecute
in interface ConnectionListenerIF
command
- what command was being executedelapsedTime
- how long the call took (in milliseconds)ConnectionListenerIF.onExecute(String, long)
public void onFail(java.lang.String command, java.lang.Exception exception)
ConnectionListenerIF
onFail
in interface ConnectionListenerIF
command
- what command was being executedexception
- what exception was thrownConnectionListenerIF.onFail(String, Exception)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |