Class PoolUtils.KeyedPoolableObjectFactoryAdaptor<K,V>
java.lang.Object
org.apache.commons.pool.PoolUtils.KeyedPoolableObjectFactoryAdaptor<K,V>
- All Implemented Interfaces:
KeyedPoolableObjectFactory<K,V>
- Enclosing class:
PoolUtils
private static class PoolUtils.KeyedPoolableObjectFactoryAdaptor<K,V>
extends Object
implements KeyedPoolableObjectFactory<K,V>
Adaptor class that turns a PoolableObjectFactory into a KeyedPoolableObjectFactory by
ignoring keys.
- Since:
- Pool 1.3
- Version:
- $Revision: 1222670 $ $Date: 2011-12-23 08:18:25 -0500 (Fri, 23 Dec 2011) $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PoolableObjectFactory<V> Underlying PoolableObjectFactory -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new KeyedPoolableObjectFactoryAdaptor using the given PoolableObjectFactory to manage objects. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateObject(K key, V obj) Activate the object, ignoring the key.voiddestroyObject(K key, V obj) Destroy the object, ignoring the key.makeObject(K key) Create a new object instance, ignoring the keyvoidpassivateObject(K key, V obj) Passivate the object, ignoring the key.toString()booleanvalidateObject(K key, V obj) Validate the object, ignoring the key
-
Field Details
-
factory
Underlying PoolableObjectFactory
-
-
Constructor Details
-
KeyedPoolableObjectFactoryAdaptor
KeyedPoolableObjectFactoryAdaptor(PoolableObjectFactory<V> factory) throws IllegalArgumentException Create a new KeyedPoolableObjectFactoryAdaptor using the given PoolableObjectFactory to manage objects.- Parameters:
factory- wrapped PoolableObjectFactory- Throws:
IllegalArgumentException- if the factory is null
-
-
Method Details
-
makeObject
Create a new object instance, ignoring the key- Specified by:
makeObjectin interfaceKeyedPoolableObjectFactory<K,V> - Parameters:
key- ignored- Returns:
- newly created object instance
- Throws:
Exception- if there is a problem creating a new instance, this will be propagated to the code requesting an object.
-
destroyObject
Destroy the object, ignoring the key.- Specified by:
destroyObjectin interfaceKeyedPoolableObjectFactory<K,V> - Parameters:
key- ignoredobj- instance to destroy- Throws:
Exception- should be avoided as it may be swallowed by the pool implementation.- See Also:
-
validateObject
Validate the object, ignoring the key- Specified by:
validateObjectin interfaceKeyedPoolableObjectFactory<K,V> - Parameters:
key- ignoredobj- object to validate- Returns:
- true if validation is successful
-
activateObject
Activate the object, ignoring the key.- Specified by:
activateObjectin interfaceKeyedPoolableObjectFactory<K,V> - Parameters:
key- ignoredobj- object to be activated- Throws:
Exception- if there is a problem activatingobj, this exception may be swallowed by the pool.- See Also:
-
passivateObject
Passivate the object, ignoring the key.- Specified by:
passivateObjectin interfaceKeyedPoolableObjectFactory<K,V> - Parameters:
key- ignoredobj- object to passivate- Throws:
Exception- if there is a problem passivatingobj, this exception may be swallowed by the pool.- See Also:
-
toString
-