001: /*
002: * @(#) ConfigMonitor 1.0 02/08/01
003: */
004:
005: package org.smartlib.pool.core;
006:
007: /**
008: * This interface defines the behavior of the class used to monitor the
009: * configuration of a pool. This interface defines the methods which can
010: * be used to monitor the runtime status of the pool configuration.
011: *
012: * @author Sachin Shekar Shetty
013: * @version 1.0, 02/08/01
014: *
015: */
016:
017: public interface ConfigMonitor {
018:
019: /**
020: * @return Name of the pool.
021: */
022: public String getMultiPoolName();
023:
024: /**
025: * @return Max connections allowed in the pool.
026: */
027: public int getMaxConnections();
028:
029: /**
030: * @return Minimun connections in the pool.
031: */
032: public int getMinConnections();
033:
034: /**
035: * @return Size of blocks of connections withdrawn at a time when no free
036: * connections are available.
037: */
038: public int getIncrement();
039:
040: /**
041: * @return Username to connect to the database.
042: */
043: public String getUserName();
044:
045: /**
046: * @return Password to connect to the database.
047: */
048: public String getPassword();
049:
050: /**
051: * @return Connection string to connect to the database.
052: */
053: public PoolConfig.ConnectionString[] getConnectionString();
054:
055: /**
056: * @return Driver name used to connect to database.
057: */
058: public String getDriver();
059:
060: /**
061: * @return True if connction leak monitoring is enabled.
062: */
063: public boolean isDetectLeaks();
064:
065: /**
066: * @return True if this pool is the default pool.
067: */
068: public boolean isDefaultPool();
069:
070: /**
071: * @return Time out for detecting leaks.
072: */
073: public long getLeakTimeOut();
074:
075: /**
076: * @return Default listener class for connection leak.
077: */
078: public String getDefaultListener();
079:
080: /**
081: * @return Poll time interval for thread detecting leaks and managing
082: * the pool size.
083: */
084: public long getPollThreadTime();
085:
086: /**
087: * @return True if automotic closing of Statement, PreparedStatement,
088: * CallableStatement is enabled.
089: */
090: public boolean isAutoClose();
091:
092: /**
093: * @return True if anonymous connections are allowed, i.e
094: * without specifying the owner.
095: */
096: public boolean isAllowAnonymousConnections();
097:
098: /**
099: * @return Maximum number of free connections allowed after which
100: * excessive connections are released.
101: */
102: public int getMaxConnectionsForRelease();
103:
104: /**
105: * @return The maximum waiting period for a thread to get a Connection.
106: * After this time interval, and ConnectionPoolException is thrown.
107: *
108: */
109: public long getConnectionWaitTimeOut();
110:
111: /**
112: * @return The Connection loader class when external pooling is enabled.
113: */
114: public PoolConfig.ConnectionLoaderClass[] getConnectionLoaderClass();
115:
116: /**
117: * This method returns the validatorQuery. This query is run each time to
118: * check for its validity before the connection is leased out.
119: *
120: * @return validatorQuery
121: */
122: public String getValidatorQuery();
123:
124: /**
125: * This method returns the max-connection-idle-time value.
126: */
127: public long getMaxConnectionIdleTime();
128:
129: /**
130: * This method returns the thread stickiness value
131: * @return
132: */
133: public boolean isThreadStickiness();
134:
135: /**
136: * This method sets the thread stickiness value
137: * @return
138: */
139: public void setThreadStickiness(boolean threadStickiness);
140:
141: }
|