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 an
ObjectPool
from the Session
by calling
getObjectPool
with a Class
object
for the class to be pooled, which must implement PooledObject
.- Author:
- Thomas Hallgren
-
Method Summary
Modifier and TypeMethodDescriptionObtain 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 Details
-
activateInstance
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
Call thePooledObject.passivate()
method and return the object to the pool.- Parameters:
instance
- The instance to passivate.- Throws:
SQLException
-
removeInstance
Call thePooledObject.remove()
method and evict the object from the pool.- Throws:
SQLException
-