tyrex.resource
public final class PoolLimits extends Object
The following XML elements are used to specify the pool limits:
Version: $Revision: 1.2 $
Field Summary | |
---|---|
static int | NO_LIMIT
Value representing no limit. |
static int | NO_TIMEOUT
Valued representing no timeout. |
Method Summary | |
---|---|
int | getInitial()
Returns the initial pool size. |
int | getMaximum()
Returns the maximum number of connections supported. |
int | getMaxRetain()
Returns the maximum time to retain an unused connection. |
int | getMinimum()
Returns the minimum number of connections required. |
int | getReuseOption()
Return the reuse option. |
String | getReuseOptionAsString()
Return the reuse option. |
int | getTimeout()
Returns the timeout when attempting to open a new connection. |
boolean | getTrace()
Returns the tracing flag. |
void | setInitial(int initial)
Sets the initial connection pool size. |
void | setMaximum(int maximum)
Sets the maximum number of connections supported. |
void | setMaxRetain(int seconds)
Sets the maximum time to retain an unused connection. |
void | setMinimum(int minimum)
Sets the minimum number of connections required. |
void | setReuseOption(int option)
Set the reuse option. |
void | setReuseOptionAsString(String option)
Set the reuse option. |
void | setTimeout(int seconds)
Sets the timeout when attempting to open a new connection. |
void | setTrace(boolean trace)
Sets the tracing flag. |
Returns: The initial pool size
Returns: The maximum number of connections supported, or zero
Returns: The maximum time to retain an unused connection (in seconds), or zero
Returns: The minimum number of connections required
Returns: One of REUSE_ON, REUSE_OFF, REUSE_TRANSACTION or REUSE_TRANSACTION_OFF
See Also: REUSE_OFF REUSE_TRANSACTION REUSE_TRANSACTION_OFF
Returns: One of REUSE_ON_NAME, REUSE_OFF_NAME, REUSE_TRANSACTION_NAME or REUSE_TRANSACTION_OFF_NAME
See Also: REUSE_OFF_NAME REUSE_TRANSACTION_NAME REUSE_TRANSACTION_OFF_NAME
Returns: The timeout when attempting to open a new connection (in seconds), or zero
Returns: True if resource manager should write trace information to the log
Parameters: initial The initial pool size
If this value is non-zero, the connection pool will not allow more connections to be opened than this upper limit. If this value is higher than the maximum connections reported by the resource manager, the latter will be used.
Parameters: maximum The maximum number of connections supported, or zero
If this number if not zero, the connection pool will attempt to release
connections that have not been used for that amount of time. The connection
pool will not release connections if the pool size is equal to the value
specified by getMinimum
.
Parameters: seconds The maximum time to retain an unused connection (in seconds), or zero
This threshold can be used to determine the number of connections that are always available in the pool. However, the connection pool will not attempt to create that number of connections directly.
Parameters: minimum The minimum number of connections required
Parameters: One of REUSE_ON, REUSE_OFF, REUSE_TRANSACTION or REUSE_TRANSACTION_OFF
Throws: IllegalArgumentException if the reuse option is not recognised.
See Also: REUSE_OFF REUSE_TRANSACTION REUSE_TRANSACTION_OFF
Parameters: One of REUSE_ON_NAME, REUSE_OFF_NAME, REUSE_TRANSACTION_NAME or REUSE_TRANSACTION_OFF_NAME
Throws: IllegalArgumentException if the reuse option is not recognised.
See Also: REUSE_OFF_NAME REUSE_TRANSACTION_NAME REUSE_TRANSACTION_OFF_NAME
If this value is not zero, the connection pool will block up to this number of
milliseconds if it is unable to obtain an existing connection. The connection
pool is not able to obtain an existing connection if the connection pool size
has reached the maximum size as specified by getMaximum
.
Parameters: timeout The timeout when attempting to open a new connection (in seconds), or zero
Parameters: trace True if resource manager should write trace information to the log