nl.knowledgeplaza.util.pool
Class RoundRobinObjectPool<T>

java.lang.Object
  extended by nl.knowledgeplaza.util.pool.BaseObjectPool<T>
      extended by nl.knowledgeplaza.util.pool.RoundRobinObjectPool<T>
All Implemented Interfaces:
ObjectPool<T>

public class RoundRobinObjectPool<T>
extends BaseObjectPool<T>
implements ObjectPool<T>

This class implements a round robin (FIFO) pool.

Version:
$Revision: 1.3 $
Author:
$Author: toeukpap $
See Also:

Nested Class Summary
 
Nested classes/interfaces inherited from class nl.knowledgeplaza.util.pool.BaseObjectPool
BaseObjectPool.NotFromThisPoolException, BaseObjectPool.TimeOutException
 
Field Summary
protected  List<T> iListOfPooledObjects
          the storage
static String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Fields inherited from class nl.knowledgeplaza.util.pool.BaseObjectPool
iClose, iListOfHandedOutObjects, iListOfHandedOutObjectsSync, iShuttingDown, iSynchronized, itestOnBorrow, MAINTENANCE_PERIOD, WHEN_EXHAUSTED_BLOCK, WHEN_EXHAUSTED_FAIL
 
Constructor Summary
RoundRobinObjectPool()
          Initialize
RoundRobinObjectPool(Collection collection)
          Initialize
RoundRobinObjectPool(PoolableObjectFactory poolableObjectFactory)
          Initialize
 
Method Summary
protected  Collection<T> getPooledObjectsImpl()
          this method allows read only access to the collection of handed out objects, used by the generic algorithm
protected  T obtainPooledObjectImpl()
          this method obtains a pooled object, the implementation determines the behaviour (LIFO, FIFO, etc)
protected  void returnPooledObjectImpl(T o)
          this method returns a pooled object, the implementation determines the behaviour (LIFO, FIFO, etc)
 
Methods inherited from class nl.knowledgeplaza.util.pool.BaseObjectPool
addObject, borrowObject, clear, close, factoryActivateObject, factoryDestroyObject, factoryMakeObject, factoryPassivateObject, factoryValidateObject, fill, getFactory, getMaxActive, getMaxIdle, getMaxWait, getName, getNameDescription, getNumActive, getNumberOfObjectsScheduledForDestruction, getNumIdle, getPooledObjects, getTestOnBorrow, getWhenExhaustedAction, invalidateObject, isClosed, isShuttingDown, isSynchronized, maintenance, obtainPooledObject, returnObject, returnPooledObject, setFactory, setMaxActive, setMaxIdle, setMaxWait, setName, setSynchronized, setTestOnBorrow, setWhenExhaustedAction, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.knowledgeplaza.util.pool.ObjectPool
addObject, borrowObject, clear, close, getNumActive, getNumIdle, invalidateObject, isSynchronized, returnObject, setFactory, setSynchronized, shutdown
 

Field Detail

SOURCECODE_VERSION

public static final String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values

iListOfPooledObjects

protected List<T> iListOfPooledObjects
the storage

Constructor Detail

RoundRobinObjectPool

public RoundRobinObjectPool()
Initialize


RoundRobinObjectPool

public RoundRobinObjectPool(PoolableObjectFactory poolableObjectFactory)
Initialize


RoundRobinObjectPool

public RoundRobinObjectPool(Collection collection)
Initialize

Method Detail

getPooledObjectsImpl

protected Collection<T> getPooledObjectsImpl()
Description copied from class: BaseObjectPool
this method allows read only access to the collection of handed out objects, used by the generic algorithm

Specified by:
getPooledObjectsImpl in class BaseObjectPool<T>

obtainPooledObjectImpl

protected T obtainPooledObjectImpl()
Description copied from class: BaseObjectPool
this method obtains a pooled object, the implementation determines the behaviour (LIFO, FIFO, etc)

Specified by:
obtainPooledObjectImpl in class BaseObjectPool<T>

returnPooledObjectImpl

protected void returnPooledObjectImpl(T o)
Description copied from class: BaseObjectPool
this method returns a pooled object, the implementation determines the behaviour (LIFO, FIFO, etc)

Specified by:
returnPooledObjectImpl in class BaseObjectPool<T>


Copyright © 2012 KnowledgePlaza. All Rights Reserved.