org.d_haven.mpool
Class DefaultPoolManager
java.lang.Object
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-10-28 15:43:09 +0200 (gio, 28 ott 2004) $
- Author:
- Berin Loritsch
Constructor Summary |
DefaultPoolManager(org.d_haven.event.command.CommandManager commandManager)
Create the DefaultPoolManager with the supplied command manager. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
m_factoryMap
private final java.util.Map m_factoryMap
m_pools
private java.util.List m_pools
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
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