org.logicalcobwebs.proxool
类 ConnectionResetter

java.lang.Object
  继承者 org.logicalcobwebs.proxool.ConnectionResetter

public class ConnectionResetter
extends Object

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.

从以下版本开始:
Proxool 0.5
版本:
$Revision: 1.16 $, $Date: 2006/01/18 14:40:01 $
作者:
Bill Horsman (bill@logicalcobwebs.co.uk), $Author: billhorsman $ (current maintainer)

字段摘要
protected static String MUTATOR_PREFIX
          We use this to guess if we are changing a property that will need resetting
protected static boolean triggerResetException
           
 
构造方法摘要
protected ConnectionResetter(org.apache.commons.logging.Log log, String driverName)
          Pass in the log to use
 
方法摘要
protected  void initialise(Connection connection)
          This gets called every time we make a Connection.
protected  boolean reset(Connection connection, String id)
          Reset this connection to its default values.
protected static void setTriggerResetException(boolean triggerResetException)
          Called by a unit test.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

MUTATOR_PREFIX

protected static final String MUTATOR_PREFIX
We use this to guess if we are changing a property that will need resetting

另请参见:
常量字段值

triggerResetException

protected static boolean triggerResetException
另请参见:
isTriggerResetException()
构造方法详细信息

ConnectionResetter

protected ConnectionResetter(org.apache.commons.logging.Log log,
                             String driverName)
Pass in the log to use

参数:
log - debug information sent here
方法详细信息

initialise

protected void initialise(Connection connection)
This gets called every time we make a Connection. Not that often really, so it's ok to synchronize a bit.

参数:
connection - this will be used to get all the default values

reset

protected boolean reset(Connection connection,
                        String id)
Reset this connection to its default values. If anything goes wrong, it is logged as a warning or info but it silently continues.

参数:
connection - to be reset
id - used in log messages
返回:
true if the reset was error free, or false if it encountered errors. (in which case it should probably not be reused)

setTriggerResetException

protected static void setTriggerResetException(boolean triggerResetException)
Called by a unit test.

参数:
triggerResetException - true it we should trigger a pretend exception.
另请参见:
isTriggerResetException()


Copyright © 2014. All rights reserved.