KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > smartlib > pool > core > ConnectionMonitor


1 /*
2  * @(#) ConnectionMonitor 1.0 02/08/01
3  */

4
5 package org.smartlib.pool.core;
6
7 /**
8  * This interface defines the behavior of the class used to monitor
9  * 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
18 public interface ConnectionMonitor {
19
20     /**
21      * @return The owner of the connections, "N/A" if this is an
22      * anonymous connection.
23      */

24     public String JavaDoc getOwner();
25
26     /**
27      * @return Timestamp at which the connection was obtained from the pool.
28      */

29     public long getConnectionObtainedTime();
30
31     /**
32      * @return Timestamp at which the connection was last accessed directly,
33      * or through Statement, PreparedStatement, CallableStatement.
34      */

35     public long getLastAccessedTime();
36
37     /**
38      * @return Whether the connection is used in a transaction.
39      */

40     public boolean isCurrentlyInTransaction();
41
42     /**
43      * returns the name of the pool that this connection belongs
44      */

45     public String JavaDoc getPoolName();
46
47 }
48
Popular Tags