org.logicalcobwebs.proxool
类 CompositeConnectionListener
java.lang.Object
org.logicalcobwebs.proxool.util.AbstractListenerContainer
org.logicalcobwebs.proxool.CompositeConnectionListener
- 所有已实现的接口:
- ConnectionListenerIF, ListenerContainerIF
public class CompositeConnectionListener
- extends AbstractListenerContainer
- implements ConnectionListenerIF
A ConnectionListenerIF that keeps a list of ConnectionListenerIFs
and notifies them in a thread safe manner.
It also implements ListenerContainerIF
which provides methods for
adding and
removing listeners.
- 从以下版本开始:
- Proxool 0.7
- 版本:
- $Revision: 1.8 $, $Date: 2007/01/25 23:38:24 $
- 作者:
- Christian Nedregaard (christian_nedregaard@email.com), $Author: billhorsman $ (current maintainer)
|
方法摘要 |
void |
onBirth(Connection connection)
Happens everytime we create a new connection. |
void |
onDeath(Connection connection,
int reasonCode)
Happens just before we expire a connection. |
void |
onExecute(String command,
long elapsedTime)
Happens after every successful execute. |
void |
onFail(String command,
Exception exception)
Happens everytime an exception was thrown during an execute method
Note that the command
is not fully implemented at this stage. |
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CompositeConnectionListener
public CompositeConnectionListener()
onBirth
public void onBirth(Connection connection)
throws SQLException
- 从接口
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.
- 指定者:
- 接口
ConnectionListenerIF 中的 onBirth
- 参数:
connection - the connection that has just been created
- 抛出:
SQLException - if anything goes wrong (which will then be logged but ignored)- 另请参见:
ConnectionListenerIF.onBirth(Connection)
onDeath
public void onDeath(Connection connection,
int reasonCode)
throws SQLException
- 从接口
ConnectionListenerIF 复制的描述
- Happens just before we expire a connection. You can use this to
reclaim resources from a connection.
- 指定者:
- 接口
ConnectionListenerIF 中的 onDeath
- 参数:
connection - the connection that is about to expirereasonCode - 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
- 抛出:
SQLException - if anything goes wrong (which will then be logged but ignored)- 另请参见:
ConnectionListenerIF.onDeath(java.sql.Connection, int)
onExecute
public void onExecute(String command,
long elapsedTime)
- 从接口
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).
- 指定者:
- 接口
ConnectionListenerIF 中的 onExecute
- 参数:
command - what command was being executedelapsedTime - how long the call took (in milliseconds)- 另请参见:
ConnectionListenerIF.onExecute(String, long)
onFail
public void onFail(String command,
Exception exception)
- 从接口
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).
- 指定者:
- 接口
ConnectionListenerIF 中的 onFail
- 参数:
command - what command was being executedexception - what exception was thrown- 另请参见:
ConnectionListenerIF.onFail(String, Exception)
Copyright © 2014. All rights reserved.