|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.transport.DefaultConfigurableKeyedObjectPool
public class DefaultConfigurableKeyedObjectPool
Implements ConfigurableKeyedObjectPool as a delegate of a KeyedPoolableObjectFactory
instance.
| Field Summary |
|---|
| Fields inherited from interface org.mule.transport.ConfigurableKeyedObjectPool |
|---|
WHEN_EXHAUSTED_BLOCK, WHEN_EXHAUSTED_FAIL, WHEN_EXHAUSTED_GROW |
| Constructor Summary | |
|---|---|
DefaultConfigurableKeyedObjectPool()
|
|
| Method Summary | |
|---|---|
void |
addObject(Object key)
|
Object |
borrowObject(Object key)
|
void |
clear()
Clears the pool, removing all pooled instances. |
void |
clear(Object key)
|
void |
close()
|
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
ConfigurableKeyedObjectPool.WHEN_EXHAUSTED_BLOCK. |
int |
getNumActive()
|
int |
getNumActive(Object key)
|
int |
getNumIdle()
|
int |
getNumIdle(Object key)
|
byte |
getWhenExhaustedAction()
Returns the action to take when the KeyedObjectPool.borrowObject(java.lang.Object) method
is invoked when the pool is exhausted. |
void |
invalidateObject(Object key,
Object obj)
|
void |
returnObject(Object key,
Object obj)
|
void |
setFactory(KeyedPoolableObjectFactory factory)
|
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
ConfigurableKeyedObjectPool.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 class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultConfigurableKeyedObjectPool()
| Method Detail |
|---|
public Object borrowObject(Object key)
throws Exception,
NoSuchElementException,
IllegalStateException
borrowObject in interface KeyedObjectPoolException
NoSuchElementException
IllegalStateException
public void returnObject(Object key,
Object obj)
throws Exception
returnObject in interface KeyedObjectPoolException
public void invalidateObject(Object key,
Object obj)
throws Exception
invalidateObject in interface KeyedObjectPoolException
public void addObject(Object key)
throws Exception,
IllegalStateException,
UnsupportedOperationException
addObject in interface KeyedObjectPoolException
IllegalStateException
UnsupportedOperationException
public int getNumIdle(Object key)
throws UnsupportedOperationException
getNumIdle in interface KeyedObjectPoolUnsupportedOperationException
public int getNumActive(Object key)
throws UnsupportedOperationException
getNumActive in interface KeyedObjectPoolUnsupportedOperationException
public int getNumIdle()
throws UnsupportedOperationException
getNumIdle in interface KeyedObjectPoolUnsupportedOperationException
public int getNumActive()
throws UnsupportedOperationException
getNumActive in interface KeyedObjectPoolUnsupportedOperationExceptionpublic void clear()
ConfigurableKeyedObjectPool
clear in interface KeyedObjectPoolclear in interface ConfigurableKeyedObjectPool
public void clear(Object key)
throws Exception,
UnsupportedOperationException
clear in interface KeyedObjectPoolException
UnsupportedOperationException
public void close()
throws Exception
close in interface KeyedObjectPoolException
public void setFactory(KeyedPoolableObjectFactory factory)
throws IllegalStateException,
UnsupportedOperationException
setFactory in interface KeyedObjectPoolIllegalStateException
UnsupportedOperationExceptionpublic int getMaxActive()
ConfigurableKeyedObjectPool
getMaxActive in interface ConfigurableKeyedObjectPoolpublic int getMaxTotal()
ConfigurableKeyedObjectPool
getMaxTotal in interface ConfigurableKeyedObjectPoolpublic void setMaxWait(long maxWait)
ConfigurableKeyedObjectPoolKeyedObjectPool.borrowObject(java.lang.Object) method should block before throwing
an exception when the pool is exhausted and the
"when exhausted" action is
ConfigurableKeyedObjectPool.WHEN_EXHAUSTED_BLOCK.
When less than or equal to 0, the KeyedObjectPool.borrowObject(java.lang.Object) method
may block indefinitely.
setMaxWait in interface ConfigurableKeyedObjectPoolmaxWait - the maximum number of milliseconds borrowObject will block or negative for indefinitely.public void setMaxActive(int maxActive)
ConfigurableKeyedObjectPool
setMaxActive in interface ConfigurableKeyedObjectPoolmaxActive - The cap on the number of active instances per key.
Use a negative value for no limit.public void setMaxIdle(int maxIdle)
ConfigurableKeyedObjectPool
setMaxIdle in interface ConfigurableKeyedObjectPoolmaxIdle - the maximum number of "idle" instances that can be held
in a given keyed pool. Use a negative value for no limit.public void setMaxTotal(int maxTotal)
ConfigurableKeyedObjectPool
setMaxTotal in interface ConfigurableKeyedObjectPoolmaxTotal - The cap on the total number of instances across pools.
Use a negative value for no limit.public int getMaxIdle()
ConfigurableKeyedObjectPool
getMaxIdle in interface ConfigurableKeyedObjectPoolpublic void setWhenExhaustedAction(byte whenExhaustedAction)
ConfigurableKeyedObjectPoolKeyedObjectPool.borrowObject(java.lang.Object) method
is invoked when the pool is exhausted.
setWhenExhaustedAction in interface ConfigurableKeyedObjectPoolwhenExhaustedAction - the action code, which must be one of
ConfigurableKeyedObjectPool.WHEN_EXHAUSTED_BLOCK, ConfigurableKeyedObjectPool.WHEN_EXHAUSTED_FAIL,
or ConfigurableKeyedObjectPool.WHEN_EXHAUSTED_GROWpublic byte getWhenExhaustedAction()
ConfigurableKeyedObjectPoolKeyedObjectPool.borrowObject(java.lang.Object) method
is invoked when the pool is exhausted.
getWhenExhaustedAction in interface ConfigurableKeyedObjectPoolConfigurableKeyedObjectPool.WHEN_EXHAUSTED_BLOCK,
ConfigurableKeyedObjectPool.WHEN_EXHAUSTED_FAIL or ConfigurableKeyedObjectPool.WHEN_EXHAUSTED_GROWpublic long getMaxWait()
ConfigurableKeyedObjectPoolKeyedObjectPool.borrowObject(java.lang.Object) method should block before throwing
an exception when the pool is exhausted and the
"when exhausted" action is
ConfigurableKeyedObjectPool.WHEN_EXHAUSTED_BLOCK.
When less than or equal to 0, the KeyedObjectPool.borrowObject(java.lang.Object) method
may block indefinitely.
getMaxWait in interface ConfigurableKeyedObjectPool
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||