|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConfigurableKeyedObjectPool
A configurable KeyedObjectPool
. Extracted from
GenericKeyedObjectPool
.
Field Summary | |
---|---|
static byte |
WHEN_EXHAUSTED_BLOCK
|
static byte |
WHEN_EXHAUSTED_FAIL
|
static byte |
WHEN_EXHAUSTED_GROW
|
Method Summary | |
---|---|
void |
clear()
Clears the pool, removing all pooled instances. |
int |
getMaxActive()
Returns the cap on the number of active instances per key. |
int |
getMaxIdle()
Returns the cap on the number of "idle" instances per key. |
int |
getMaxTotal()
Returns the overall maximum number of objects (across pools) that can exist at one time. |
long |
getMaxWait()
Returns the maximum amount of time (in milliseconds) the KeyedObjectPool.borrowObject(java.lang.Object) method should block before throwing
an exception when the pool is exhausted and the
"when exhausted" action is
WHEN_EXHAUSTED_BLOCK . |
byte |
getWhenExhaustedAction()
Returns the action to take when the KeyedObjectPool.borrowObject(java.lang.Object) method
is invoked when the pool is exhausted. |
void |
setMaxActive(int maxActive)
Sets the cap on the number of active instances per key. |
void |
setMaxIdle(int maxIdle)
Sets the cap on the number of "idle" instances in the pool. |
void |
setMaxTotal(int maxTotal)
Sets the cap on the total number of instances from all pools combined. |
void |
setMaxWait(long maxWait)
Sets the maximum amount of time (in milliseconds) the KeyedObjectPool.borrowObject(java.lang.Object) method should block before throwing
an exception when the pool is exhausted and the
"when exhausted" action is
WHEN_EXHAUSTED_BLOCK . |
void |
setWhenExhaustedAction(byte whenExhaustedAction)
Sets the action to take when the KeyedObjectPool.borrowObject(java.lang.Object) method
is invoked when the pool is exhausted. |
Methods inherited from interface org.apache.commons.pool.KeyedObjectPool |
---|
addObject, borrowObject, clear, close, getNumActive, getNumActive, getNumIdle, getNumIdle, invalidateObject, returnObject, setFactory |
Field Detail |
---|
static final byte WHEN_EXHAUSTED_FAIL
static final byte WHEN_EXHAUSTED_BLOCK
static final byte WHEN_EXHAUSTED_GROW
Method Detail |
---|
void clear()
clear
in interface KeyedObjectPool
int getMaxTotal()
void setMaxTotal(int maxTotal)
maxTotal
- The cap on the total number of instances across pools.
Use a negative value for no limit.int getMaxActive()
void setMaxActive(int maxActive)
maxActive
- The cap on the number of active instances per key.
Use a negative value for no limit.long getMaxWait()
KeyedObjectPool.borrowObject(java.lang.Object)
method should block before throwing
an exception when the pool is exhausted and the
"when exhausted" action
is
WHEN_EXHAUSTED_BLOCK
.
When less than or equal to 0, the KeyedObjectPool.borrowObject(java.lang.Object)
method
may block indefinitely.
void setMaxWait(long maxWait)
KeyedObjectPool.borrowObject(java.lang.Object)
method should block before throwing
an exception when the pool is exhausted and the
"when exhausted" action
is
WHEN_EXHAUSTED_BLOCK
.
When less than or equal to 0, the KeyedObjectPool.borrowObject(java.lang.Object)
method
may block indefinitely.
maxWait
- the maximum number of milliseconds borrowObject will block or negative for indefinitely.int getMaxIdle()
void setMaxIdle(int maxIdle)
maxIdle
- the maximum number of "idle" instances that can be held
in a given keyed pool. Use a negative value for no limit.void setWhenExhaustedAction(byte whenExhaustedAction)
KeyedObjectPool.borrowObject(java.lang.Object)
method
is invoked when the pool is exhausted.
whenExhaustedAction
- the action code, which must be one of
WHEN_EXHAUSTED_BLOCK
, WHEN_EXHAUSTED_FAIL
,
or WHEN_EXHAUSTED_GROW
byte getWhenExhaustedAction()
KeyedObjectPool.borrowObject(java.lang.Object)
method
is invoked when the pool is exhausted.
WHEN_EXHAUSTED_BLOCK
,
WHEN_EXHAUSTED_FAIL
or WHEN_EXHAUSTED_GROW
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |