| |
|
| org.enhydra.jdbc.core.CoreDataSource org.enhydra.jdbc.pool.StandardPoolDataSource
All known Subclasses: org.enhydra.jdbc.pool.StandardXAPoolDataSource,
StandardPoolDataSource | public class StandardPoolDataSource extends CoreDataSource implements DataSource,PoolHelper,ConnectionEventListener(Code) | | StandardPoolDataSource class allows to make some operations on
PooledConnection. It implements PoolHelper for the 3 methods :
create : create a PooledConnection
create(user,password) : create a PooledConnection with an other user/password
testThisObject : check if the object is still valid
checkThisObject : check if the object is closed
expire : kill the object
|
onOff | public boolean onOff(Code) | | |
StandardPoolDataSource | public StandardPoolDataSource()(Code) | | Constructor
|
StandardPoolDataSource | public StandardPoolDataSource(int initSize)(Code) | | Constructor
|
checkThisObject | public boolean checkThisObject(Object o)(Code) | | This method tests if a connection is closed or not
|
connectionClosed | public void connectionClosed(ConnectionEvent event)(Code) | | Invoked when the application calls close()
on its representation of the connection
|
connectionErrorOccurred | public void connectionErrorOccurred(ConnectionEvent event)(Code) | | connectionErrorOccurred and connectionClosed are methods
from ConnectionEventListener interface
Invoked when a fatal connection error occurs,
just before an SQLException is thrown to the application
|
expire | public void expire(Object o)(Code) | | object specific work to kill the object
|
getCheckLevelObject | public int getCheckLevelObject()(Code) | | |
getConnection | public Connection getConnection() throws SQLException(Code) | | getConnection allows to get an object from the pool and returns it
to the user. In this case, we return an PooledConnection
|
getConnection | public Connection getConnection(String _user, String _password) throws SQLException(Code) | | getConnection allows to get an object from the pool and returns it
to the user. In this case, we return an PooledConnection
|
getDeadLockMaxWait | public long getDeadLockMaxWait()(Code) | | |
getDeadLockRetryWait | public long getDeadLockRetryWait()(Code) | | |
getGeneration | public int getGeneration()(Code) | | |
getLifeTime | public long getLifeTime()(Code) | | |
getLockedObjectCount | public int getLockedObjectCount()(Code) | | |
getMaxLifeTime | public long getMaxLifeTime()(Code) | | |
getMaxSize | public int getMaxSize()(Code) | | |
getMinSize | public int getMinSize()(Code) | | |
getReference | public Reference getReference() throws NamingException(Code) | | Retrieves the Reference of this object. Used at binding time by JNDI
to build a reference on this object.
The non-null Reference of this object. exception: NamingException - If a naming exception was encountered whileretrieving the reference. |
getSleepTime | public long getSleepTime()(Code) | | |
getUnlockedObjectCount | public int getUnlockedObjectCount()(Code) | | |
isGC | public boolean isGC()(Code) | | |
setCheckLevelObject | public void setCheckLevelObject(int checkLevelObject)(Code) | | set the check level of the pooled object before using them
Parameters: checkLevelObject - ( 0 = no special checking1 = just a check on an object2 = test the object3 = just a check on an object (for all the objects)4 = test the object (for all the objects) |
setDataSourceName | public void setDataSourceName(String dataSourceName)(Code) | | Set up the data source name, get the initial context,
and lookup in JNDI to obtain a reference of the DataSourceName
this method must be called before a getConnection (in this case
an exception is returned
|
setDeadLockMaxWait | public void setDeadLockMaxWait(long deadLock)(Code) | | set the global time the pool can wait for a free object
Parameters: deadLock - in milliseconds |
setDeadLockRetryWait | public void setDeadLockRetryWait(long loopWait)(Code) | | set the time before 2 tries when trying to obtain an object from the pool
Parameters: loopWait - in milliseconds |
setDebug | public void setDebug(boolean debug)(Code) | | set the debug flag
Parameters: debug - a boolean flag |
setGC | public void setGC(boolean gc)(Code) | | set the garbage collection option
Parameters: gc - true: the garbage collector will be launched when clean up of thepool, else false |
setGeneration | public void setGeneration(int generation)(Code) | | set the generation number for future connection, the generation number
is used to identify a group a created objects
Parameters: generation - an integer value which represents a generation |
setJdbcTestStmt | public void setJdbcTestStmt(String jdbcTestStmt)(Code) | | set the String to test the jdbc connection before using it
Parameters: jdbcTestStmt - an sql statement |
setLifeTime | public void setLifeTime(long lifeTime)(Code) | | set the life time of the pooled objects
Parameters: lifeTime - life time of the pooled objects (in milliseconds) |
setLogWriter | public void setLogWriter(PrintWriter logWriter)(Code) | | set the logwriter for the current object, the logwriter will be use by
the current object and by the generic pool
Parameters: logWriter - a PrintWriter object |
setMaxLifeTime | public void setMaxLifeTime(long maxLifeTime)(Code) | | |
setMaxSize | public void setMaxSize(int maxSize) throws Exception(Code) | | set the maximum size of the pool
Parameters: maxSize - maximum size of the pool throws: Exception - |
setMinSize | public void setMinSize(int minSize) throws Exception(Code) | | set the minimum size of the pool
Parameters: minSize - minimum size of the pool throws: Exception - |
setSleepTime | public void setSleepTime(long sleepTime)(Code) | | set the sleep time of pooled objects
Parameters: sleepTime - sleep time of the pooled objects (in milliseconds) |
setThreadFactory | public void setThreadFactory(JdbcThreadFactory tf)(Code) | | Override this so that the pool's tf gets set as well
|
shutdown | public void shutdown(boolean force)(Code) | | |
stopPool | public void stopPool()(Code) | | stop method to switch off the pool
|
testThisObject | public boolean testThisObject(Object o)(Code) | | This method tests if a connection is valid or not
|
|
|
|