KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#) ConfigMonitor 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 the
9  * configuration of a pool. This interface defines the methods which can
10  * be used to monitor the runtime status of the pool configuration.
11  *
12  * @author Sachin Shekar Shetty
13  * @version 1.0, 02/08/01
14  *
15  */

16
17
18 public interface ConfigMonitor {
19
20     /**
21      * @return Name of the pool.
22      */

23     public String JavaDoc getMultiPoolName();
24
25     /**
26      * @return Max connections allowed in the pool.
27      */

28     public int getMaxConnections();
29
30     /**
31      * @return Minimun connections in the pool.
32      */

33     public int getMinConnections();
34     
35     /**
36      * @return Size of blocks of connections withdrawn at a time when no free
37      * connections are available.
38      */

39     public int getIncrement();
40     
41     /**
42      * @return Username to connect to the database.
43      */

44     public String JavaDoc getUserName();
45     
46     /**
47      * @return Password to connect to the database.
48      */

49     public String JavaDoc getPassword() ;
50     
51     /**
52      * @return Connection string to connect to the database.
53      */

54     public PoolConfig.ConnectionString[] getConnectionString();
55
56     /**
57      * @return Driver name used to connect to database.
58      */

59     public String JavaDoc getDriver();
60     
61     /**
62      * @return True if connction leak monitoring is enabled.
63      */

64     public boolean isDetectLeaks();
65     
66     /**
67      * @return True if this pool is the default pool.
68      */

69     public boolean isDefaultPool();
70
71     /**
72      * @return Time out for detecting leaks.
73      */

74     public long getLeakTimeOut();
75     
76     /**
77      * @return Default listener class for connection leak.
78      */

79     public String JavaDoc getDefaultListener();
80     
81     /**
82      * @return Poll time interval for thread detecting leaks and managing
83      * the pool size.
84      */

85     public long getPollThreadTime();
86
87     /**
88      * @return True if automotic closing of Statement, PreparedStatement,
89      * CallableStatement is enabled.
90      */

91     public boolean isAutoClose();
92     
93     /**
94      * @return True if anonymous connections are allowed, i.e
95      * without specifying the owner.
96      */

97     public boolean isAllowAnonymousConnections();
98     
99     /**
100      * @return Maximum number of free connections allowed after which
101      * excessive connections are released.
102      */

103     public int getMaxConnectionsForRelease();
104
105     /**
106      * @return The maximum waiting period for a thread to get a Connection.
107      * After this time interval, and ConnectionPoolException is thrown.
108      *
109      */

110     public long getConnectionWaitTimeOut();
111
112     /**
113      * @return The Connection loader class when external pooling is enabled.
114      */

115     public PoolConfig.ConnectionLoaderClass[] getConnectionLoaderClass();
116
117     /**
118      * This method returns the validatorQuery. This query is run each time to
119      * check for its validity before the connection is leased out.
120      *
121      * @return validatorQuery
122      */

123     public String JavaDoc getValidatorQuery();
124
125   /**
126      * This method returns the max-connection-idle-time value.
127      */

128     public long getMaxConnectionIdleTime();
129
130
131     /**
132      * This method returns the thread stickiness value
133      * @return
134      */

135     public boolean isThreadStickiness();
136
137
138     /**
139      * This method sets the thread stickiness value
140      * @return
141      */

142     public void setThreadStickiness(boolean threadStickiness);
143   
144 }
145
Popular Tags