org.n52.security.common.util
Class AbstractObjectPool<PooledObject,Key>

java.lang.Object
  extended by org.n52.security.common.util.AbstractObjectPool<PooledObject,Key>
All Implemented Interfaces:
ObjectPool<PooledObject,Key>
Direct Known Subclasses:
DefaultDocumentBuilderPool

public abstract class AbstractObjectPool<PooledObject,Key>
extends Object
implements ObjectPool<PooledObject,Key>

Very simple implementation of a ObjectPool.


Constructor Summary
AbstractObjectPool(int cachedObjLimit)
           
 
Method Summary
 PooledObject acquire(Key key)
           
abstract  PooledObject create(Key key)
          only create needs to be implemented by sub classes.
 void destroy()
           
 void destroy(Key key, PooledObject obj)
           
 void release(PooledObject obj, Key key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractObjectPool

public AbstractObjectPool(int cachedObjLimit)
Method Detail

acquire

public PooledObject acquire(Key key)
Specified by:
acquire in interface ObjectPool<PooledObject,Key>

release

public void release(PooledObject obj,
                    Key key)
Specified by:
release in interface ObjectPool<PooledObject,Key>

destroy

public void destroy(Key key,
                    PooledObject obj)

destroy

public void destroy()

create

public abstract PooledObject create(Key key)
only create needs to be implemented by sub classes.



Copyright © 2004–2014 52north.org. All rights reserved.