org.apache.avalon.excalibur.component
Class DefaultComponentPoolController

java.lang.Object
  |
  +--org.apache.avalon.excalibur.component.DefaultComponentPoolController
All Implemented Interfaces:
PoolController, org.apache.avalon.framework.thread.ThreadSafe

public class DefaultComponentPoolController
extends java.lang.Object
implements PoolController, org.apache.avalon.framework.thread.ThreadSafe

This is the PoolController for the Avalon Excalibur Component Management Framework.

Since:
4.0
Version:
CVS $Revision: 1.4 $ $Date: 2001/12/11 09:53:27 $
Author:
Giacomo Pati, Berin Loritsch

Field Summary
static int DEFAULT_AMOUNT
          Default increase/decrease amount
protected  int m_amount
          Used increase/decrease amount
 
Constructor Summary
DefaultComponentPoolController()
          The default constructor.
DefaultComponentPoolController(int amount)
          The alternate constructor.
 
Method Summary
 int grow()
          Called when a Pool reaches it's minimum.
 int shrink()
          Called when a pool reaches it's maximum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_AMOUNT

public static final int DEFAULT_AMOUNT
Default increase/decrease amount

m_amount

protected final int m_amount
Used increase/decrease amount
Constructor Detail

DefaultComponentPoolController

public DefaultComponentPoolController()
The default constructor. It initializes the used increase/ decrease amount to the default.

DefaultComponentPoolController

public DefaultComponentPoolController(int amount)
The alternate constructor. It initializes the used increase/ decrease amount to the specified number only if it is greater than 0. Otherwise it uses the default amount.
Parameters:
amount - The amount to grow and shrink a pool by.
Method Detail

grow

public int grow()
Called when a Pool reaches it's minimum. Return the number of elements to increase pool by.
Specified by:
grow in interface PoolController
Returns:
the element increase

shrink

public int shrink()
Called when a pool reaches it's maximum. Returns the number of elements to decrease pool by.
Specified by:
shrink in interface PoolController
Returns:
the element decrease


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.