|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.pool.BaseKeyedPoolableObjectFactory<K,V>
K - the type of keys in this poolV - the type of objects held in this poolpublic abstract class BaseKeyedPoolableObjectFactory<K,V>
A base implementation of KeyedPoolableObjectFactory.
All operations defined here are essentially no-op's.
KeyedPoolableObjectFactory| Constructor Summary | |
|---|---|
BaseKeyedPoolableObjectFactory()
|
|
| Method Summary | |
|---|---|
void |
activateObject(K key,
V obj)
Reinitialize an instance to be returned by the pool. |
void |
destroyObject(K key,
V obj)
Destroy an instance no longer needed by the pool. |
abstract V |
makeObject(K key)
Create an instance that can be served by the pool. |
void |
passivateObject(K key,
V obj)
Uninitialize an instance to be returned to the idle object pool. |
boolean |
validateObject(K key,
V obj)
Ensures that the instance is safe to be returned by the pool. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BaseKeyedPoolableObjectFactory()
| Method Detail |
|---|
public abstract V makeObject(K key)
throws Exception
makeObject in interface KeyedPoolableObjectFactory<K,V>key - the key used when constructing the object
Exception - if there is a problem creating a new instance,
this will be propagated to the code requesting an object.
public void destroyObject(K key,
V obj)
throws Exception
The default implementation is a no-op.
destroyObject in interface KeyedPoolableObjectFactory<K,V>key - the key used when selecting the instanceobj - the instance to be destroyed
Exception - should be avoided as it may be swallowed by
the pool implementation.KeyedPoolableObjectFactory.validateObject(K, V),
KeyedObjectPool.invalidateObject(K, V)
public boolean validateObject(K key,
V obj)
The default implementation always returns true.
validateObject in interface KeyedPoolableObjectFactory<K,V>key - the key used when selecting the objectobj - the instance to be validated
true in the default implementation
public void activateObject(K key,
V obj)
throws Exception
The default implementation is a no-op.
activateObject in interface KeyedPoolableObjectFactory<K,V>key - the key used when selecting the objectobj - the instance to be activated
Exception - if there is a problem activating obj,
this exception may be swallowed by the pool.KeyedPoolableObjectFactory.destroyObject(K, V)
public void passivateObject(K key,
V obj)
throws Exception
The default implementation is a no-op.
passivateObject in interface KeyedPoolableObjectFactory<K,V>key - the key used when selecting the objectobj - the instance to be passivated
Exception - if there is a problem passivating obj,
this exception may be swallowed by the pool.KeyedPoolableObjectFactory.destroyObject(K, V)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||