org.logicalcobwebs.proxool
接口 ConnectionPoolDefinitionIF


public interface ConnectionPoolDefinitionIF

A full definition of everything to do with a connection. You can get one of these from ProxoolFacade.

 String alias = "myPool";
 ConnectionPoolDefinitionIF cpd = ProxoolFacade.getConnectionPoolDefinition(alias);
 
If you want to update the definition you should either update the properties definition next time you ask for a connection or call Proxool directly.

版本:
$Revision: 1.23 $, $Date: 2007/06/19 11:33:35 $
作者:
billhorsman, $Author: billhorsman $ (current maintainer)

字段摘要
static int DEBUG_LEVEL_LOUD
           
static int DEBUG_LEVEL_QUIET
           
static int DEFAULT_HOUSE_KEEPING_SLEEP_TIME
          30000 (30 Seconds)
static int DEFAULT_MAXIMUM_ACTIVE_TIME
          300000 (5 minutes)
static int DEFAULT_MAXIMUM_CONNECTION_COUNT
          15
static int DEFAULT_MAXIMUM_CONNECTION_LIFETIME
          4 * 60 * 60 * 1000 (4 hours)
static int DEFAULT_MAXIMUM_NEW_CONNECTIONS
          已过时。 use DEFAULT_SIMULTANEOUS_BUILD_THROTTLE instead
static int DEFAULT_MINIMUM_CONNECTION_COUNT
          0
static int DEFAULT_OVERLOAD_WITHOUT_REFUSAL_THRESHOLD
          60000
static int DEFAULT_PROTOTYPE_COUNT
          0
static int DEFAULT_RECENTLY_STARTED_THRESHOLD
          60000
static int DEFAULT_SIMULTANEOUS_BUILD_THROTTLE
          10
static String FATAL_SQL_EXCEPTIONS_DELIMITER
           
static String PASSWORD_PROPERTY
           
static String USER_PROPERTY
           
 
方法摘要
 String getAlias()
          The name associated with this connection pool.
 String getCompleteUrl()
          The URL that was used to define this pool.
 int getDebugLevel()
          已过时。 use isVerbose() instead
 Properties getDelegateProperties()
          Get all of the properties that are defined on the delegated driver.
 String getDelegateProperty(String name)
           
 String getDriver()
           
 Set getFatalSqlExceptions()
          Get the list of fatal SQL exception (Strings) fragments that will trigger the death of a Connection.
 String getFatalSqlExceptionWrapper()
          If this is not-null then any fatal SQLException is wrapped up inside an instance of this class.
 long getHouseKeepingSleepTime()
          This is the time the house keeping thread sleeps for between checks.
 String getHouseKeepingTestSql()
          The test SQL that we perform to see if a connection is alright.
 String getInitialContextFactory()
          JNDI property
 Class getInjectableCallableStatementInterface()
          The class name of an interface that should be injected everytime we make a CallableStatement.
 Class getInjectableConnectionInterface()
          The class name of an interface that should be injected everytime we make a Connection.
 Class getInjectablePreparedStatementInterface()
          The class name of an interface that should be injected everytime we make a PreparedStatement.
 Class getInjectableStatementInterface()
          The class name of an interface that should be injected everytime we make a Statement.
 String getJdbcDriverVersion()
           
 String getJmxAgentId()
          Get a comma separated list of JMX agent ids (as used by MBeanServerFactory.findMBeanServer(String agentId)) to register the pool to.
 String getJndiName()
          JNDI property
 long getMaximumActiveTime()
          If the housekeeper comes across a thread that has been active for longer than this then it will kill it.
 int getMaximumConnectionCount()
          The maximum number of connections to the database
 long getMaximumConnectionLifetime()
          The maximum amount of time that a connection exists for before it is killed (recycled).
 int getMaximumNewConnections()
          已过时。 use more descriptive getSimultaneousBuildThrottle() instead
 int getMinimumConnectionCount()
          The minimum number of connections we will keep open, regardless of whether anyone needs them or not.
 String getName()
          已过时。 use getAlias() instead.
 long getOverloadWithoutRefusalLifetime()
          This is the time in milliseconds after the last time that we refused a connection that we still consider ourselves to be overloaded.
 String getPassword()
          The password to use to login to the database
 Properties getProperties()
          已过时。 use less ambiguous getDelegateProperties() instead
 int getPrototypeCount()
          This is the number of spare connections we will strive to have.
 String getProviderUrl()
          JNDI property
 long getRecentlyStartedThreshold()
          As long as we have one connection that was started within this threshold then we consider the pool to be up.
 String getSecurityAuthentication()
          JNDI property
 String getSecurityCredentials()
          JNDI property
 String getSecurityPrincipal()
          JNDI property
 int getSimultaneousBuildThrottle()
          In order to prevent overloading, this is the maximum number of connections that you can have that are in the progress of being made.
 String getStatistics()
          The sample length (in seconds) when taking statistical information, or null to disable statistics.
 String getStatisticsLogLevel()
          Whether statistics are logged as they are produced.
 String getUrl()
          This is the URL used to connect to the database. e.g. driver:@host:port:database.
 String getUser()
           
 boolean isJmx()
          Indicate wether this pool should be registered with JMX or not.
 boolean isTestAfterUse()
          Whether we test each connection after it is closed (that is, returned to the pool)
 boolean isTestBeforeUse()
          Whether we test each connection before it is served
 boolean isTrace()
          if this is true then we will log each execution.
 boolean isVerbose()
          If this is true then we start logging a lot of stuff everytime we serve a connection and everytime the house keeper and prototyper run.
 

字段详细信息

DEFAULT_MAXIMUM_CONNECTION_LIFETIME

static final int DEFAULT_MAXIMUM_CONNECTION_LIFETIME
4 * 60 * 60 * 1000 (4 hours)

另请参见:
常量字段值

DEFAULT_MAXIMUM_ACTIVE_TIME

static final int DEFAULT_MAXIMUM_ACTIVE_TIME
300000 (5 minutes)

另请参见:
常量字段值

DEFAULT_PROTOTYPE_COUNT

static final int DEFAULT_PROTOTYPE_COUNT
0

另请参见:
常量字段值

DEFAULT_MINIMUM_CONNECTION_COUNT

static final int DEFAULT_MINIMUM_CONNECTION_COUNT
0

另请参见:
常量字段值

DEFAULT_MAXIMUM_CONNECTION_COUNT

static final int DEFAULT_MAXIMUM_CONNECTION_COUNT
15

另请参见:
常量字段值

DEFAULT_HOUSE_KEEPING_SLEEP_TIME

static final int DEFAULT_HOUSE_KEEPING_SLEEP_TIME
30000 (30 Seconds)

另请参见:
常量字段值

DEFAULT_MAXIMUM_NEW_CONNECTIONS

static final int DEFAULT_MAXIMUM_NEW_CONNECTIONS
已过时。 use DEFAULT_SIMULTANEOUS_BUILD_THROTTLE instead
10

另请参见:
常量字段值

DEFAULT_SIMULTANEOUS_BUILD_THROTTLE

static final int DEFAULT_SIMULTANEOUS_BUILD_THROTTLE
10

另请参见:
常量字段值

DEFAULT_OVERLOAD_WITHOUT_REFUSAL_THRESHOLD

static final int DEFAULT_OVERLOAD_WITHOUT_REFUSAL_THRESHOLD
60000

另请参见:
常量字段值

DEFAULT_RECENTLY_STARTED_THRESHOLD

static final int DEFAULT_RECENTLY_STARTED_THRESHOLD
60000

另请参见:
常量字段值

DEBUG_LEVEL_QUIET

static final int DEBUG_LEVEL_QUIET
另请参见:
常量字段值

DEBUG_LEVEL_LOUD

static final int DEBUG_LEVEL_LOUD
另请参见:
常量字段值

USER_PROPERTY

static final String USER_PROPERTY
另请参见:
常量字段值

PASSWORD_PROPERTY

static final String PASSWORD_PROPERTY
另请参见:
常量字段值

FATAL_SQL_EXCEPTIONS_DELIMITER

static final String FATAL_SQL_EXCEPTIONS_DELIMITER
另请参见:
getFatalSqlExceptions(), 常量字段值
方法详细信息

getHouseKeepingSleepTime

long getHouseKeepingSleepTime()
This is the time the house keeping thread sleeps for between checks. (milliseconds)


getMaximumConnectionCount

int getMaximumConnectionCount()
The maximum number of connections to the database


getMaximumConnectionLifetime

long getMaximumConnectionLifetime()
The maximum amount of time that a connection exists for before it is killed (recycled). (milliseconds)


getMaximumNewConnections

int getMaximumNewConnections()
已过时。 use more descriptive getSimultaneousBuildThrottle() instead

In order to prevent overloading, this is the maximum number of connections that you can have that are in the progress of being made. That is, ones we have started to make but haven't finished yet.


getSimultaneousBuildThrottle

int getSimultaneousBuildThrottle()
In order to prevent overloading, this is the maximum number of connections that you can have that are in the progress of being made. That is, ones we have started to make but haven't finished yet.


getMinimumConnectionCount

int getMinimumConnectionCount()
The minimum number of connections we will keep open, regardless of whether anyone needs them or not.


getName

String getName()
已过时。 use getAlias() instead.


getAlias

String getAlias()
The name associated with this connection pool. This is how you identify this pool when you need to use it.


getPassword

String getPassword()
The password to use to login to the database


getPrototypeCount

int getPrototypeCount()
This is the number of spare connections we will strive to have. So, if we have a prototypeCount of 5 but only 3 spare connections the prototyper will make an additional 2. This is important because it can take around a seconds to establish a connection, and if we are being very strict about killing connections when they get too old it happens a fair bit.


getUrl

String getUrl()
This is the URL used to connect to the database. e.g. driver:@host:port:database.


getUser

String getUser()

getJdbcDriverVersion

String getJdbcDriverVersion()

getProperties

Properties getProperties()
已过时。 use less ambiguous getDelegateProperties() instead

Get all of the properties that are defined on the delegated driver.

返回:
the delegate properties

getDriver

String getDriver()

getRecentlyStartedThreshold

long getRecentlyStartedThreshold()
As long as we have one connection that was started within this threshold then we consider the pool to be up. (That is, not down). This allows us to differentiate between having all the connections frozen and just being really busy.


getOverloadWithoutRefusalLifetime

long getOverloadWithoutRefusalLifetime()
This is the time in milliseconds after the last time that we refused a connection that we still consider ourselves to be overloaded. We have to do this because, even when overloaded, it's not impossible for the available connection count to be high and it's possible to be serving a lot of connections. Recognising an overload is easy (we refuse a connection) - it's recognising when we stop being overloaded that is hard. Hence this fudge :)


getMaximumActiveTime

long getMaximumActiveTime()
If the housekeeper comes across a thread that has been active for longer than this then it will kill it. So make sure you set this to a number bigger than your slowest expected response!


getDebugLevel

int getDebugLevel()
已过时。 use isVerbose() instead


getFatalSqlExceptions

Set getFatalSqlExceptions()
Get the list of fatal SQL exception (Strings) fragments that will trigger the death of a Connection. All SQLExceptions are caught and tested for containing this text fragment. If it matches than this connection is considered useless and it is discarded. Regardless of what happens the exception is always thrown back to the user.

返回:
the list of exception fragments (String)
另请参见:
FATAL_SQL_EXCEPTIONS_DELIMITER

getHouseKeepingTestSql

String getHouseKeepingTestSql()
The test SQL that we perform to see if a connection is alright. Should be fast and robust.

返回:
house keeping test SQL

isTestBeforeUse

boolean isTestBeforeUse()
Whether we test each connection before it is served

返回:
true if we do the test
另请参见:
getHouseKeepingTestSql()

isTestAfterUse

boolean isTestAfterUse()
Whether we test each connection after it is closed (that is, returned to the pool)

返回:
true if we do the test
另请参见:
getHouseKeepingTestSql()

getCompleteUrl

String getCompleteUrl()
The URL that was used to define this pool. For example: proxool:org.hsqldb.jdbcDriver:jdbc:hsqldb:test

返回:
the complete url

isVerbose

boolean isVerbose()
If this is true then we start logging a lot of stuff everytime we serve a connection and everytime the house keeper and prototyper run. Be prepared for a lot of debug!

返回:
true if in verbose mode

isTrace

boolean isTrace()
if this is true then we will log each execution. The SQL used and the execution time.

返回:
true if we should log each execution

getStatistics

String getStatistics()
The sample length (in seconds) when taking statistical information, or null to disable statistics. Default is null. You can comma delimit a series of periods. The suffix for the period is either "s" (seconds), "m" (minutes), "h" (hours) or "d" (days). For example: "15s,1h" would give two separate sample rates: every 15 seconds and every hour.

返回:
statistics definition

getStatisticsLogLevel

String getStatisticsLogLevel()
Whether statistics are logged as they are produced. Range: DEBUG, INFO, WARN, ERROR, FATAL. Default is null (no logging)

返回:
statisticsLogLevel

getDelegateProperties

Properties getDelegateProperties()
Get all of the properties that are defined on the delegated driver.

返回:
the delegate properties

getDelegateProperty

String getDelegateProperty(String name)

getFatalSqlExceptionWrapper

String getFatalSqlExceptionWrapper()
If this is not-null then any fatal SQLException is wrapped up inside an instance of this class. If null, then the original exception is thrown. Range: any valid class name that is a subclass of SQLException or RuntimeException Default: null (original exception is thrown)

返回:
the class name to use for fatal SQL exceptions

getInitialContextFactory

String getInitialContextFactory()
JNDI property

返回:
the initial context factory

getProviderUrl

String getProviderUrl()
JNDI property

返回:
provider URL

getSecurityAuthentication

String getSecurityAuthentication()
JNDI property

返回:
security authentication

getSecurityPrincipal

String getSecurityPrincipal()
JNDI property

返回:
security principal

getSecurityCredentials

String getSecurityCredentials()
JNDI property

返回:
security credentials

getJndiName

String getJndiName()
JNDI property

返回:
JNDI name

isJmx

boolean isJmx()
Indicate wether this pool should be registered with JMX or not.

返回:
wether this pool should be registered with JMX or not.

getJmxAgentId

String getJmxAgentId()
Get a comma separated list of JMX agent ids (as used by MBeanServerFactory.findMBeanServer(String agentId)) to register the pool to.

返回:
a comma separated list of JMX agent ids (as used by MBeanServerFactory.findMBeanServer(String agentId)) to register the pool to.

getInjectableConnectionInterface

Class getInjectableConnectionInterface()
The class name of an interface that should be injected everytime we make a Connection. Use this when you want to access methods on a concrete class in the vendor's Connection object that aren't declared in a public interface. Without this, the connection that gets served will only give you access to public interfaces (like Connection and any other vendor provided ones)

返回:
the interface

getInjectableStatementInterface

Class getInjectableStatementInterface()
The class name of an interface that should be injected everytime we make a Statement. Use this when you want to access methods on a concrete class in the vendor's Statement object that aren't declared in a public interface. Without this, the statement that is provided will only give you access to public interfaces (like Statement and any other vendor provided ones)

返回:
the interface

getInjectablePreparedStatementInterface

Class getInjectablePreparedStatementInterface()
The class name of an interface that should be injected everytime we make a PreparedStatement. Use this when you want to access methods on a concrete class in the vendor's PreparedStatement object that aren't declared in a public interface. Without this, the PreparedStatement that is provided will only give you access to public interfaces (like PreparedStatement and any other vendor provided ones)

返回:
the interface

getInjectableCallableStatementInterface

Class getInjectableCallableStatementInterface()
The class name of an interface that should be injected everytime we make a CallableStatement. Use this when you want to access methods on a concrete class in the vendor's CallableStatement object that aren't declared in a public interface. Without this, the CallableStatement that is provided will only give you access to public interfaces (like CallableStatement and any other vendor provided ones)

返回:
the interface


Copyright © 2014. All rights reserved.