|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tyrex.resource.PoolLimits
Represents limits placed on a connection pool. The limits are read from the configuration file and apply to the connection pool.
The following XML elements are used to specify the pool limits:
Field Summary | |
static int |
NO_LIMIT
Value representing no limit. |
static int |
NO_TIMEOUT
Valued representing no timeout. |
Constructor Summary | |
PoolLimits()
|
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. |
java.lang.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(java.lang.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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NO_LIMIT
public static final int NO_TIMEOUT
Constructor Detail |
public PoolLimits()
Method Detail |
public void setMaximum(int maximum)
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.
maximum
- The maximum number of connections supported, or zeropublic int getMaximum()
public void setMinimum(int minimum)
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.
minimum
- The minimum number of connections requiredpublic int getMinimum()
public void setInitial(int initial)
initial
- The initial pool sizepublic int getInitial()
public void setMaxRetain(int seconds)
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
.
seconds
- The maximum time to retain an unused connection (in seconds),
or zeropublic int getMaxRetain()
public void setTimeout(int seconds)
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
.
public int getTimeout()
public void setTrace(boolean trace)
trace
- True if resource manager should write trace information
to the logpublic boolean getTrace()
public void setReuseOptionAsString(java.lang.String option)
java.lang.IllegalArgumentException
- if the reuse option is not
recognised.ReuseOptions.REUSE_OFF_NAME
,
ReuseOptions.REUSE_TRANSACTION_NAME
,
ReuseOptions.REUSE_TRANSACTION_OFF_NAME
public java.lang.String getReuseOptionAsString()
ReuseOptions.REUSE_ON_NAME
,
ReuseOptions.REUSE_OFF_NAME
,
ReuseOptions.REUSE_TRANSACTION_NAME
or
ReuseOptions.REUSE_TRANSACTION_OFF_NAME
ReuseOptions.REUSE_OFF_NAME
,
ReuseOptions.REUSE_TRANSACTION_NAME
,
ReuseOptions.REUSE_TRANSACTION_OFF_NAME
public void setReuseOption(int option)
java.lang.IllegalArgumentException
- if the reuse option is not
recognised.ReuseOptions.REUSE_OFF
,
ReuseOptions.REUSE_TRANSACTION
,
ReuseOptions.REUSE_TRANSACTION_OFF
public int getReuseOption()
ReuseOptions.REUSE_ON
,
ReuseOptions.REUSE_OFF
,
ReuseOptions.REUSE_TRANSACTION
or
ReuseOptions.REUSE_TRANSACTION_OFF
ReuseOptions.REUSE_OFF
,
ReuseOptions.REUSE_TRANSACTION
,
ReuseOptions.REUSE_TRANSACTION_OFF
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |