Package com.sun.ejb.containers.util.pool
Class BlockingPool
- java.lang.Object
-
- com.sun.ejb.containers.util.pool.AbstractPool
-
- com.sun.ejb.containers.util.pool.NonBlockingPool
-
- com.sun.ejb.containers.util.pool.BlockingPool
-
- All Implemented Interfaces:
Pool
public class BlockingPool extends NonBlockingPool
- Author:
- lprimak
-
-
Field Summary
-
Fields inherited from class com.sun.ejb.containers.util.pool.NonBlockingPool
addedIdleBeanWork, addedResizeTask, inResizing, singletonBeanPool
-
Fields inherited from class com.sun.ejb.containers.util.pool.AbstractPool
_logger, appName, beanId, configData, containerClassLoader, createdCount, destroyedCount, ejbName, factory, idleTimeoutInSeconds, list, maxPoolSize, maxWaitTimeInMillis, modName, poolName, poolProbeNotifier, poolReturned, poolSuccess, resizeQuantity, steadyPoolSize, waitCount
-
-
Constructor Summary
Constructors Constructor Description BlockingPool(long containerId, String name, ObjectFactory sessionCtxFactory, int steadyPoolSize, int poolResizeQuantity, int maxPoolSize, int poolIdleTimeoutInSeconds, ClassLoader loader, boolean singletonBeanPool, int maxWaitTimeInMillis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroyObject(Object object)
Destroys an Object.Object
getObject(Object param)
Get an object from the pool within the specified time.protected void
remove(int count)
void
returnObject(Object object)
Return an object back to the pool.-
Methods inherited from class com.sun.ejb.containers.util.pool.NonBlockingPool
close, doResize, getAllAttrValues, preload, prepopulate, removeIdleObjects
-
Methods inherited from class com.sun.ejb.containers.util.pool.AbstractPool
appendStats, getAllMonitoredAttrbuteValues, getCreatedCount, getDestroyedCount, getIdleTimeoutInSeconds, getJmsMaxMessagesLoad, getMaxPoolSize, getMaxWaitTimeInMillis, getNumBeansInPool, getNumThreadsWaiting, getObject, getObject, getPoolSuccess, getResizeQuantity, getSize, getSteadyPoolSize, getTotalBeansCreated, getTotalBeansDestroyed, getWaitCount, setConfigData, setContainerClassLoader, setInfo, unregisterProbeProvider
-
-
-
-
Constructor Detail
-
BlockingPool
public BlockingPool(long containerId, String name, ObjectFactory sessionCtxFactory, int steadyPoolSize, int poolResizeQuantity, int maxPoolSize, int poolIdleTimeoutInSeconds, ClassLoader loader, boolean singletonBeanPool, int maxWaitTimeInMillis)
-
-
Method Detail
-
getObject
public Object getObject(Object param) throws PoolException
Description copied from interface:Pool
Get an object from the pool within the specified time. The amount of time the calling thread agrees to wait. Some value that might be used while creating the object- Specified by:
getObject
in interfacePool
- Overrides:
getObject
in classNonBlockingPool
- Returns:
- an Object or null if an object could not be returned in 'waitForMillis' millisecond.
- Throws:
PoolException
- if an object cannot be created
-
returnObject
public void returnObject(Object object)
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).- Specified by:
returnObject
in interfacePool
- Overrides:
returnObject
in classNonBlockingPool
-
destroyObject
public void destroyObject(Object object)
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.- Specified by:
destroyObject
in interfacePool
- Overrides:
destroyObject
in classNonBlockingPool
- Parameters:
object
- Object to be destroyed.
-
remove
protected void remove(int count)
- Overrides:
remove
in classNonBlockingPool
-
-