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 voiddestroyObject(Object object)Destroys an Object.ObjectgetObject(Object param)Get an object from the pool within the specified time.protected voidremove(int count)voidreturnObject(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:PoolGet 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:
getObjectin interfacePool- Overrides:
getObjectin 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:
returnObjectin interfacePool- Overrides:
returnObjectin 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:
destroyObjectin interfacePool- Overrides:
destroyObjectin classNonBlockingPool- Parameters:
object- Object to be destroyed.
-
remove
protected void remove(int count)
- Overrides:
removein classNonBlockingPool
-
-