|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.logicalcobwebs.proxool.ConnectionResetter
public class ConnectionResetter
Responsible for resetting a Connection to its default state when it is returned to the pool. It must be initialised by the first Connection that is made (for each pool) so that we don't make any assumptions about what the default values are.
Field Summary | |
---|---|
private java.util.Map |
accessorMutatorMap
|
private java.util.Map |
defaultValues
|
private java.lang.String |
driverName
|
private boolean |
initialised
|
private Log |
log
|
protected static java.lang.String |
MUTATOR_PREFIX
We use this to guess if we are changing a property that will need resetting |
protected static boolean |
triggerResetException
|
Constructor Summary | |
---|---|
protected |
ConnectionResetter(Log log,
java.lang.String driverName)
Pass in the log to use |
Method Summary | |
---|---|
private void |
addReset(java.lang.String accessorName,
java.lang.String mutatorName)
Add a pair of methods that need resetting each time a connection is put back in the pool |
protected void |
initialise(java.sql.Connection connection)
This gets called every time we make a Connection. |
private static boolean |
isTriggerResetException()
|
protected boolean |
reset(java.sql.Connection connection,
java.lang.String id)
Reset this connection to its default values. |
protected static void |
setTriggerResetException(boolean triggerResetException)
Called by a unit test. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Log log
private boolean initialised
initialise(java.sql.Connection)
private java.util.Map accessorMutatorMap
addReset(java.lang.String, java.lang.String)
,
reset(java.sql.Connection, java.lang.String)
private java.util.Map defaultValues
addReset(java.lang.String, java.lang.String)
,
reset(java.sql.Connection, java.lang.String)
protected static final java.lang.String MUTATOR_PREFIX
private java.lang.String driverName
protected static boolean triggerResetException
isTriggerResetException()
Constructor Detail |
---|
protected ConnectionResetter(Log log, java.lang.String driverName)
log
- debug information sent hereMethod Detail |
---|
private void addReset(java.lang.String accessorName, java.lang.String mutatorName)
accessorName
- the name of the "getter" method (e.g. getAutoCommit)mutatorName
- teh name of the "setter" method (e.g. setAutoCommit)protected void initialise(java.sql.Connection connection)
connection
- this will be used to get all the default valuesprotected boolean reset(java.sql.Connection connection, java.lang.String id)
connection
- to be resetid
- used in log messages
private static boolean isTriggerResetException()
protected static void setTriggerResetException(boolean triggerResetException)
triggerResetException
- true it we should trigger a pretend exception.isTriggerResetException()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |