FileDocCategorySizeDatePackage
Pool.javaAPI DocGlassfish v2 API4224Fri May 04 22:33:00 BST 2007com.sun.ejb.containers.util.pool

Pool

public interface Pool
Pool defines the methods that can be used by the application to access pooled objects. The basic assumption is that all objects in the pool are identical (homogeneous). This interface defines methods for a) getting an object from the pool, b) returning an object back to the pool and, c) destroying (instead of reusing) an object. In addition to these methods, the Pool has methods for adding and removing PoolEventListeners. There are six overloaded methods for getting objects from a pool.

Fields Summary
Constructors Summary
Methods Summary
public voiddestroyObject(java.lang.Object obj)
Destroys an Object. Note that applications should not ignore the reference to the object that they got from getObject(). An object that is obtained through getObject() must always be returned back to the pool using either returnObject(obj) or through destroyObject(obj). This method tells that the object should be destroyed and cannot be reused.

public java.lang.ObjectgetObject(boolean canWait, java.lang.Object param)

deprecated

public java.lang.ObjectgetObject(long maxWaitTime, java.lang.Object param)

deprecated

public java.lang.ObjectgetObject(java.lang.Object param)
Get an object from the pool within the specified time.

param
The amount of time the calling thread agrees to wait.
param
Some value that might be used while creating the object
return
an Object or null if an object could not be returned in 'waitForMillis' millisecond.
exception
Throws PoolException if an object cannot be created

public voidreturnObject(java.lang.Object obj)
Return an object back to the pool. An object that is obtained through getObject() must always be returned back to the pool using either returnObject(obj) or through destroyObject(obj).