Module org.postgresql.pljava
Package org.postgresql.pljava
Interface ObjectPool<T extends PooledObject>
-
public interface ObjectPool<T extends PooledObject>
A pool of objects of a single class. Obtain anObjectPool
from theSession
by callinggetObjectPool
with aClass
object for the class to be pooled, which must implementPooledObject
.- Author:
- Thomas Hallgren
-
-
Method Summary
Modifier and Type Method Description T
activateInstance()
Obtain a pooled object, calling itsPooledObject.activate()
method.void
passivateInstance(T instance)
Call thePooledObject.passivate()
method and return the object to the pool.void
removeInstance(T instance)
Call thePooledObject.remove()
method and evict the object from the pool.
-
-
-
Method Detail
-
activateInstance
T activateInstance() throws SQLException
Obtain a pooled object, calling itsPooledObject.activate()
method. A new instance is created if needed. The pooled object is removed from the pool and activated.- Returns:
- A new object or an object found in the pool.
- Throws:
SQLException
-
passivateInstance
void passivateInstance(T instance) throws SQLException
Call thePooledObject.passivate()
method and return the object to the pool.- Parameters:
instance
- The instance to passivate.- Throws:
SQLException
-
removeInstance
void removeInstance(T instance) throws SQLException
Call thePooledObject.remove()
method and evict the object from the pool.- Throws:
SQLException
-
-