org.apache.avalon.excalibur.pool
Class AbstractPool
java.lang.Object
|
+--org.apache.avalon.framework.logger.AbstractLogEnabled
|
+--org.apache.avalon.excalibur.pool.AbstractPool
- All Implemented Interfaces:
- Component, LogEnabled, Pool, ThreadSafe
- Direct Known Subclasses:
- DefaultPool
- public abstract class AbstractPool
- extends AbstractLogEnabled
- implements Pool, ThreadSafe
This is an Pool
that caches Poolable objects for reuse.
- Since:
- 4.0
- Version:
- CVS $Revision: 1.9 $ $Date: 2003/03/07 13:36:06 $
- Author:
- Berin Loritsch
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_POOL_SIZE
public static final int DEFAULT_POOL_SIZE
- See Also:
- Constant Field Values
m_factory
protected final ObjectFactory m_factory
m_active
protected List m_active
m_ready
protected org.apache.commons.collections.Buffer m_ready
m_mutex
protected Mutex m_mutex
m_initialized
protected boolean m_initialized
m_min
protected int m_min
AbstractPool
public AbstractPool(ObjectFactory factory)
throws Exception
- Create an AbstractPool. The pool requires a factory, and can
optionally have a controller.
initialize
protected void initialize()
throws Exception
Exception
lock
protected final void lock()
throws InterruptedException
InterruptedException
unlock
protected final void unlock()
throws InterruptedException
InterruptedException
newPoolable
protected Poolable newPoolable()
throws Exception
- This is the method to override when you need to enforce creational
policies.
Exception
removePoolable
protected void removePoolable(Poolable poolable)
- This is the method to override when you need to enforce destructional
policies.
size
public final int size()
get
public abstract Poolable get()
throws Exception
- Specified by:
get
in interface Pool
Exception
put
public abstract void put(Poolable object)
- Specified by:
put
in interface Pool
internalGrow
protected void internalGrow(int amount)
throws Exception
Exception
internalShrink
protected void internalShrink(int amount)
throws Exception
Exception
Copyright © 2000-2002 Apache Jakarta Project. All Rights Reserved.