|
|||||||||
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);
Field Summary | |
---|---|
static int |
FATAL_SQL_EXCEPTION_DETECTED
We are killing a connection because a FATAL_SQL_EXCEPTION
has been detected. |
static int |
HOUSE_KEEPER_TEST_FAIL
We are killing a connection because the routine house keeper test failed |
static int |
MANUAL_EXPIRY
We are killing a connection because it's manually been expired (by something external to Proxool) |
static int |
MAXIMUM_ACTIVE_TIME_EXPIRED
We are killing a connection because the MAXIMUM_ACTIVE_TIME
has been exceeded. |
static int |
MAXIMUM_CONNECTION_LIFETIME_EXCEEDED
We are killing a connection because it's MAXIMUM_CONNECTION_LIFETIME
has been exceeded. |
static int |
RESET_FAIL
We are killing a connection because it couldn't be reset
after it was returned to the pool and we don't want to give it out again in an unknown state. |
static int |
SHUTDOWN
We are killing a connection because Proxool is shutting down |
static int |
VALIDATION_FAIL
We are killing a connection because it has not been validated . |
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. |
Field Detail |
---|
static final int MAXIMUM_ACTIVE_TIME_EXPIRED
MAXIMUM_ACTIVE_TIME
has been exceeded.
onDeath(java.sql.Connection, int)
,
Constant Field Valuesstatic final int MANUAL_EXPIRY
onDeath(java.sql.Connection, int)
,
Constant Field Valuesstatic final int VALIDATION_FAIL
validated
.
onDeath(java.sql.Connection, int)
,
Constant Field Valuesstatic final int SHUTDOWN
onDeath(java.sql.Connection, int)
,
Constant Field Valuesstatic final int RESET_FAIL
reset
after it was returned to the pool and we don't want to give it out again in an unknown state.
onDeath(java.sql.Connection, int)
,
Constant Field Valuesstatic final int HOUSE_KEEPER_TEST_FAIL
onDeath(java.sql.Connection, int)
,
Constant Field Valuesstatic final int MAXIMUM_CONNECTION_LIFETIME_EXCEEDED
MAXIMUM_CONNECTION_LIFETIME
has been exceeded.
onDeath(java.sql.Connection, int)
,
Constant Field Valuesstatic final int FATAL_SQL_EXCEPTION_DETECTED
FATAL_SQL_EXCEPTION
has been detected.
onDeath(java.sql.Connection, int)
,
Constant Field ValuesMethod 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, int reasonCode) throws java.sql.SQLException
connection
- the connection that is about to expirereasonCode
- MAXIMUM_ACTIVE_TIME_EXPIRED
,
HOUSE_KEEPER_TEST_FAIL
,
FATAL_SQL_EXCEPTION_DETECTED
,
MANUAL_EXPIRY
,
MAXIMUM_CONNECTION_LIFETIME_EXCEEDED
,
RESET_FAIL
,
SHUTDOWN
, or
VALIDATION_FAIL
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 |