org.d_haven.mpool

Class DefaultPoolManager

public class DefaultPoolManager extends 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
Mapm_factoryMap
Listm_pools
Constructor Summary
DefaultPoolManager(CommandManager commandManager)
Create the DefaultPoolManager with the supplied command manager.
Method Summary
PoolgetManagedPool(ObjectFactory factory, int initialEntries)
Return a managed pool that has a controller.
StringtoString()

Field Detail

m_factoryMap

private final Map m_factoryMap

m_pools

private List m_pools

Constructor Detail

DefaultPoolManager

public DefaultPoolManager(CommandManager commandManager)
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: SinkException if the CommandManager cannot enqueue the ManagePoolsCommand

Method Detail

getManagedPool

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

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: Exception if there is a problem creating the pool

toString

public String toString()