01: /*
02: * @(#) ConnectionMonitor 1.0 02/08/01
03: */
04:
05: package org.smartlib.pool.core;
06:
07: /**
08: * This interface defines the behavior of the class used to monitor
09: * a Connection. This interface defines the methods which can
10: * be used to monitor the runtime status of the Connection.
11: *
12: * @author Sachin Shekar Shetty
13: * @version 1.0, 02/08/01
14: *
15: */
16:
17: public interface ConnectionMonitor {
18:
19: /**
20: * @return The owner of the connections, "N/A" if this is an
21: * anonymous connection.
22: */
23: public String getOwner();
24:
25: /**
26: * @return Timestamp at which the connection was obtained from the pool.
27: */
28: public long getConnectionObtainedTime();
29:
30: /**
31: * @return Timestamp at which the connection was last accessed directly,
32: * or through Statement, PreparedStatement, CallableStatement.
33: */
34: public long getLastAccessedTime();
35:
36: /**
37: * @return Whether the connection is used in a transaction.
38: */
39: public boolean isCurrentlyInTransaction();
40:
41: /**
42: * returns the name of the pool that this connection belongs
43: */
44: public String getPoolName();
45:
46: }
|