|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.pool2.BasePooledObjectFactory<T>
T
- Type of element managed in this factory.public abstract class BasePooledObjectFactory<T>
A base implementation of PoolableObjectFactory
.
All operations defined here are essentially no-op's.
This class is immutable, and therefore thread-safe
PooledObjectFactory
,
BaseKeyedPooledObjectFactory
Constructor Summary | |
---|---|
BasePooledObjectFactory()
|
Method Summary | |
---|---|
void |
activateObject(PooledObject<T> p)
No-op. |
abstract T |
create()
Creates an object instance, to be wrapped in a PooledObject . |
void |
destroyObject(PooledObject<T> p)
No-op. |
PooledObject<T> |
makeObject()
Create an instance that can be served by the pool and wrap it in a PooledObject to be managed by the pool. |
void |
passivateObject(PooledObject<T> p)
No-op. |
boolean |
validateObject(PooledObject<T> p)
This implementation always returns true . |
abstract PooledObject<T> |
wrap(T obj)
Wrap the provided instance with an implementation of PooledObject . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasePooledObjectFactory()
Method Detail |
---|
public abstract T create() throws Exception
PooledObject
.
This method must support concurrent, multi-threaded activation.
Exception
public abstract PooledObject<T> wrap(T obj)
PooledObject
.
obj
- the instance to wrap
PooledObject
public PooledObject<T> makeObject() throws Exception
PooledObjectFactory
PooledObject
to be managed by the pool.
makeObject
in interface PooledObjectFactory<T>
PooledObject
wrapping an instance that can be served by the pool
Exception
- if there is a problem creating a new instance,
this will be propagated to the code requesting an object.public void destroyObject(PooledObject<T> p) throws Exception
destroyObject
in interface PooledObjectFactory<T>
p
- ignored
Exception
- should be avoided as it may be swallowed by
the pool implementation.PooledObjectFactory.validateObject(org.apache.commons.pool2.PooledObject)
,
ObjectPool.invalidateObject(T)
public boolean validateObject(PooledObject<T> p)
true
.
validateObject
in interface PooledObjectFactory<T>
p
- ignored
true
public void activateObject(PooledObject<T> p) throws Exception
activateObject
in interface PooledObjectFactory<T>
p
- ignored
Exception
- if there is a problem activating obj
,
this exception may be swallowed by the pool.PooledObjectFactory.destroyObject(org.apache.commons.pool2.PooledObject)
public void passivateObject(PooledObject<T> p) throws Exception
passivateObject
in interface PooledObjectFactory<T>
p
- ignored
Exception
- if there is a problem passivating obj
,
this exception may be swallowed by the pool.PooledObjectFactory.destroyObject(org.apache.commons.pool2.PooledObject)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |