Package org.apache.tomcat.dbcp.pool2
Class BasePooledObjectFactory<T>
- java.lang.Object
- 
- org.apache.tomcat.dbcp.pool2.BaseObject
- 
- org.apache.tomcat.dbcp.pool2.BasePooledObjectFactory<T>
 
 
- 
- Type Parameters:
- T- Type of element managed in this factory.
 - All Implemented Interfaces:
- PooledObjectFactory<T>
 
 public abstract class BasePooledObjectFactory<T> extends BaseObject implements PooledObjectFactory<T> A base implementation ofPoolableObjectFactory.All operations defined here are essentially no-op's. This class is immutable, and therefore thread-safe - Since:
- 2.0
- See Also:
- PooledObjectFactory,- BaseKeyedPooledObjectFactory
 
- 
- 
Constructor SummaryConstructors Constructor Description BasePooledObjectFactory()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidactivateObject(PooledObject<T> p)No-op.abstract Tcreate()Creates an object instance, to be wrapped in aPooledObject.voiddestroyObject(PooledObject<T> p)No-op.PooledObject<T>makeObject()Creates an instance that can be served by the pool and wrap it in aPooledObjectto be managed by the pool.voidpassivateObject(PooledObject<T> p)No-op.booleanvalidateObject(PooledObject<T> p)Always returnstrue.abstract PooledObject<T>wrap(T obj)Wraps the provided instance with an implementation ofPooledObject.- 
Methods inherited from class org.apache.tomcat.dbcp.pool2.BaseObjecttoString, toStringAppendFields
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.apache.tomcat.dbcp.pool2.PooledObjectFactorydestroyObject
 
- 
 
- 
- 
- 
Method Detail- 
activateObjectpublic void activateObject(PooledObject<T> p) throws java.lang.Exception No-op.- Specified by:
- activateObjectin interface- PooledObjectFactory<T>
- Parameters:
- p- ignored
- Throws:
- java.lang.Exception- if there is a problem activating- obj, this exception may be swallowed by the pool.
- See Also:
- PooledObjectFactory.destroyObject(org.apache.tomcat.dbcp.pool2.PooledObject<T>)
 
 - 
createpublic abstract T create() throws java.lang.Exception Creates an object instance, to be wrapped in aPooledObject.This method must support concurrent, multi-threaded activation. - Returns:
- an instance to be served by the pool
- Throws:
- java.lang.Exception- if there is a problem creating a new instance, this will be propagated to the code requesting an object.
 
 - 
destroyObjectpublic void destroyObject(PooledObject<T> p) throws java.lang.Exception No-op.- Specified by:
- destroyObjectin interface- PooledObjectFactory<T>
- Parameters:
- p- ignored
- Throws:
- java.lang.Exception- should be avoided as it may be swallowed by the pool implementation.
- See Also:
- PooledObjectFactory.validateObject(org.apache.tomcat.dbcp.pool2.PooledObject<T>),- ObjectPool.invalidateObject(T)
 
 - 
makeObjectpublic PooledObject<T> makeObject() throws java.lang.Exception Description copied from interface:PooledObjectFactoryCreates an instance that can be served by the pool and wrap it in aPooledObjectto be managed by the pool.- Specified by:
- makeObjectin interface- PooledObjectFactory<T>
- Returns:
- a PooledObjectwrapping an instance that can be served by the pool
- Throws:
- java.lang.Exception- if there is a problem creating a new instance, this will be propagated to the code requesting an object.
 
 - 
passivateObjectpublic void passivateObject(PooledObject<T> p) throws java.lang.Exception No-op.- Specified by:
- passivateObjectin interface- PooledObjectFactory<T>
- Parameters:
- p- ignored
- Throws:
- java.lang.Exception- if there is a problem passivating- obj, this exception may be swallowed by the pool.
- See Also:
- PooledObjectFactory.destroyObject(org.apache.tomcat.dbcp.pool2.PooledObject<T>)
 
 - 
validateObjectpublic boolean validateObject(PooledObject<T> p) Always returnstrue.- Specified by:
- validateObjectin interface- PooledObjectFactory<T>
- Parameters:
- p- ignored
- Returns:
- true
 
 - 
wrappublic abstract PooledObject<T> wrap(T obj) Wraps the provided instance with an implementation ofPooledObject.- Parameters:
- obj- the instance to wrap
- Returns:
- The provided instance, wrapped by a PooledObject
 
 
- 
 
-