|
||||||||||
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 KeyedObjectPool
Exception
NoSuchElementException
IllegalStateException
public void returnObject(Object key, Object obj) throws Exception
returnObject
in interface KeyedObjectPool
Exception
public void invalidateObject(Object key, Object obj) throws Exception
invalidateObject
in interface KeyedObjectPool
Exception
public void addObject(Object key) throws Exception, IllegalStateException, UnsupportedOperationException
addObject
in interface KeyedObjectPool
Exception
IllegalStateException
UnsupportedOperationException
public int getNumIdle(Object key) throws UnsupportedOperationException
getNumIdle
in interface KeyedObjectPool
UnsupportedOperationException
public int getNumActive(Object key) throws UnsupportedOperationException
getNumActive
in interface KeyedObjectPool
UnsupportedOperationException
public int getNumIdle() throws UnsupportedOperationException
getNumIdle
in interface KeyedObjectPool
UnsupportedOperationException
public int getNumActive() throws UnsupportedOperationException
getNumActive
in interface KeyedObjectPool
UnsupportedOperationException
public void clear()
ConfigurableKeyedObjectPool
clear
in interface KeyedObjectPool
clear
in interface ConfigurableKeyedObjectPool
public void clear(Object key) throws Exception, UnsupportedOperationException
clear
in interface KeyedObjectPool
Exception
UnsupportedOperationException
public void close() throws Exception
close
in interface KeyedObjectPool
Exception
public void setFactory(KeyedPoolableObjectFactory factory) throws IllegalStateException, UnsupportedOperationException
setFactory
in interface KeyedObjectPool
IllegalStateException
UnsupportedOperationException
public int getMaxActive()
ConfigurableKeyedObjectPool
getMaxActive
in interface ConfigurableKeyedObjectPool
public int getMaxTotal()
ConfigurableKeyedObjectPool
getMaxTotal
in interface ConfigurableKeyedObjectPool
public void setMaxWait(long maxWait)
ConfigurableKeyedObjectPool
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
.
When less than or equal to 0, the KeyedObjectPool.borrowObject(java.lang.Object)
method
may block indefinitely.
setMaxWait
in interface ConfigurableKeyedObjectPool
maxWait
- the maximum number of milliseconds borrowObject will block or negative for indefinitely.public void setMaxActive(int maxActive)
ConfigurableKeyedObjectPool
setMaxActive
in interface ConfigurableKeyedObjectPool
maxActive
- 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 ConfigurableKeyedObjectPool
maxIdle
- 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 ConfigurableKeyedObjectPool
maxTotal
- The cap on the total number of instances across pools.
Use a negative value for no limit.public int getMaxIdle()
ConfigurableKeyedObjectPool
getMaxIdle
in interface ConfigurableKeyedObjectPool
public void setWhenExhaustedAction(byte whenExhaustedAction)
ConfigurableKeyedObjectPool
KeyedObjectPool.borrowObject(java.lang.Object)
method
is invoked when the pool is exhausted.
setWhenExhaustedAction
in interface ConfigurableKeyedObjectPool
whenExhaustedAction
- the action code, which must be one of
ConfigurableKeyedObjectPool.WHEN_EXHAUSTED_BLOCK
, ConfigurableKeyedObjectPool.WHEN_EXHAUSTED_FAIL
,
or ConfigurableKeyedObjectPool.WHEN_EXHAUSTED_GROW
public byte getWhenExhaustedAction()
ConfigurableKeyedObjectPool
KeyedObjectPool.borrowObject(java.lang.Object)
method
is invoked when the pool is exhausted.
getWhenExhaustedAction
in interface ConfigurableKeyedObjectPool
ConfigurableKeyedObjectPool.WHEN_EXHAUSTED_BLOCK
,
ConfigurableKeyedObjectPool.WHEN_EXHAUSTED_FAIL
or ConfigurableKeyedObjectPool.WHEN_EXHAUSTED_GROW
public long getMaxWait()
ConfigurableKeyedObjectPool
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
.
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 |