org.d_haven.mpool
Class DefaultPoolManager

java.lang.Object
  extended by org.d_haven.mpool.DefaultPoolManager
All Implemented Interfaces:
PoolManager

public class DefaultPoolManager
extends java.lang.Object
implements PoolManager

This interface is for a PoolManager that creates pools that are managed asynchronously. The contract is that the controller type is specified in the constructor.

Version:
CVS $Revision: 1.7 $ $Date: 2004/06/21 17:03:46 $
Author:
Berin Loritsch

Field Summary
private  java.util.Map m_factoryMap
           
private  java.util.List m_pools
           
 
Constructor Summary
DefaultPoolManager(org.d_haven.event.command.CommandManager commandManager)
          Create the DefaultPoolManager with the supplied command manager.
 
Method Summary
 Pool getManagedPool(ObjectFactory factory, int initialEntries)
          Return a managed pool that has a controller.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_factoryMap

private final java.util.Map m_factoryMap

m_pools

private java.util.List m_pools
Constructor Detail

DefaultPoolManager

public DefaultPoolManager(org.d_haven.event.command.CommandManager commandManager)
                   throws org.d_haven.event.SinkException
Create the DefaultPoolManager with the supplied command manager. The command manager must be started before creating this object.

Parameters:
commandManager - the CommandManager to use to manage the pools
Throws:
org.d_haven.event.SinkException - if the CommandManager cannot enqueue the ManagePoolsCommand
Method Detail

getManagedPool

public Pool getManagedPool(ObjectFactory factory,
                           int initialEntries)
                    throws java.lang.Exception
Return a managed pool that has a controller.

Specified by:
getManagedPool in interface PoolManager
Parameters:
factory - the factory used for the pool.
initialEntries - the number of items to start with in the pool
Returns:
the new or existing pool for that factory
Throws:
java.lang.Exception - if there is a problem creating the pool

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object