|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConnectionListenerIF
You can listen to the lifecycle of a connection. Sometimes, you may
want to perform a task when the connection is born or dies. Actually,
the reason why we originally did this is now obsolete. But the code
remains here just in case. You need to
register
your implementation with ProxoolFacade.
String alias = "myPool";
ConnectionListenerIF myConnectionListener = new MyConnectionListener();
ProxoolFacade.addConnectionListener
(alias, myConnectionListener);
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. |
Method Detail |
---|
void onBirth(java.sql.Connection connection) throws java.sql.SQLException
connection
- the connection that has just been created
java.sql.SQLException
- if anything goes wrong (which will then be logged but ignored)void onDeath(java.sql.Connection connection) throws java.sql.SQLException
connection
- the connection that is about to expire
java.sql.SQLException
- if anything goes wrong (which will then be logged but ignored)void onExecute(java.lang.String command, long elapsedTime)
command
- what command was being executedelapsedTime
- how long the call took (in milliseconds)void onFail(java.lang.String command, java.lang.Exception exception)
command
- what command was being executedexception
- what exception was thrown
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |