org.apache.avalon.excalibur.pool
Class DefaultPool

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.excalibur.pool.AbstractPool
          extended byorg.apache.avalon.excalibur.pool.DefaultPool
All Implemented Interfaces:
Disposable, LogEnabled, Pool, ThreadSafe
Direct Known Subclasses:
SoftResourceLimitingPool

public class DefaultPool
extends AbstractPool
implements Disposable

This is an Pool that caches Poolable objects for reuse. Please note that this pool offers no resource limiting whatsoever.

Since:
4.0
Version:
CVS $Revision: 1.6 $ $Date: 2004/03/29 16:50:37 $
Author:
Avalon Development Team

Field Summary
protected  PoolController m_controller
           
protected  boolean m_disposed
           
protected  int m_max
           
protected  int m_min
           
protected  boolean m_quickFail
           
 
Fields inherited from class org.apache.avalon.excalibur.pool.AbstractPool
DEFAULT_POOL_SIZE, m_active, m_factory, m_initialized, m_mutex, m_ready
 
Constructor Summary
DefaultPool(java.lang.Class clazz, int initial)
           
DefaultPool(java.lang.Class clazz, int initial, int maximum)
           
DefaultPool(ObjectFactory factory)
           
DefaultPool(ObjectFactory factory, PoolController controller)
           
DefaultPool(ObjectFactory factory, PoolController controller, int initial, int maximum)
           
 
Method Summary
 void dispose()
          The dispose operation is called at the end of a components lifecycle.
 Poolable get()
           
 void put(Poolable obj)
           
 
Methods inherited from class org.apache.avalon.excalibur.pool.AbstractPool
initialize, internalGrow, internalShrink, lock, newPoolable, removePoolable, size, unlock
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_min

protected int m_min

m_max

protected int m_max

m_controller

protected PoolController m_controller

m_disposed

protected boolean m_disposed

m_quickFail

protected boolean m_quickFail
Constructor Detail

DefaultPool

public DefaultPool(ObjectFactory factory,
                   PoolController controller)
            throws java.lang.Exception

DefaultPool

public DefaultPool(ObjectFactory factory,
                   PoolController controller,
                   int initial,
                   int maximum)
            throws java.lang.Exception

DefaultPool

public DefaultPool(ObjectFactory factory)
            throws java.lang.Exception

DefaultPool

public DefaultPool(java.lang.Class clazz,
                   int initial,
                   int maximum)
            throws java.lang.NoSuchMethodException,
                   java.lang.Exception

DefaultPool

public DefaultPool(java.lang.Class clazz,
                   int initial)
            throws java.lang.NoSuchMethodException,
                   java.lang.Exception
Method Detail

get

public Poolable get()
             throws java.lang.Exception
Specified by:
get in interface Pool
Specified by:
get in class AbstractPool
Throws:
java.lang.Exception

put

public void put(Poolable obj)
Specified by:
put in interface Pool
Specified by:
put in class AbstractPool

dispose

public final void dispose()
Description copied from interface: Disposable
The dispose operation is called at the end of a components lifecycle. This method will be called after Startable.stop() method (if implemented by component). Components use this method to release and destroy any resources that the Component owns.

Specified by:
dispose in interface Disposable


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.