org.apache.commons.performance.pool
Class WaiterFactory
java.lang.Object
org.apache.commons.performance.pool.WaiterFactory
- All Implemented Interfaces:
- KeyedPoolableObjectFactory, PoolableObjectFactory
public class WaiterFactory
- extends Object
- implements PoolableObjectFactory, KeyedPoolableObjectFactory
Object factory with configurable latencies for object lifecycle methods.
Constructor Summary |
WaiterFactory(long activateLatency,
long destroyLatency,
long makeLatency,
long passivateLatency,
long validateLatency,
long waiterLatency)
|
WaiterFactory(long activateLatency,
long destroyLatency,
long makeLatency,
long passivateLatency,
long validateLatency,
long waiterLatency,
long maxActive)
|
WaiterFactory(long activateLatency,
long destroyLatency,
long makeLatency,
long passivateLatency,
long validateLatency,
long waiterLatency,
long maxActive,
long maxActivePerKey)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected static final Logger logger
WaiterFactory
public WaiterFactory(long activateLatency,
long destroyLatency,
long makeLatency,
long passivateLatency,
long validateLatency,
long waiterLatency,
long maxActive,
long maxActivePerKey)
WaiterFactory
public WaiterFactory(long activateLatency,
long destroyLatency,
long makeLatency,
long passivateLatency,
long validateLatency,
long waiterLatency)
WaiterFactory
public WaiterFactory(long activateLatency,
long destroyLatency,
long makeLatency,
long passivateLatency,
long validateLatency,
long waiterLatency,
long maxActive)
activateObject
public void activateObject(Object arg0)
throws Exception
- Specified by:
activateObject
in interface PoolableObjectFactory
- Throws:
Exception
destroyObject
public void destroyObject(Object arg0)
throws Exception
- Specified by:
destroyObject
in interface PoolableObjectFactory
- Throws:
Exception
makeObject
public Object makeObject()
throws Exception
- Specified by:
makeObject
in interface PoolableObjectFactory
- Throws:
Exception
passivateObject
public void passivateObject(Object arg0)
throws Exception
- Specified by:
passivateObject
in interface PoolableObjectFactory
- Throws:
Exception
validateObject
public boolean validateObject(Object arg0)
- Specified by:
validateObject
in interface PoolableObjectFactory
doWait
protected void doWait(long latency)
reset
public void reset()
getMaxActive
public long getMaxActive()
- Returns:
- the maxActive
setMaxActive
public void setMaxActive(long maxActive)
- Parameters:
maxActive
- the maxActive to set
activateObject
public void activateObject(Object key,
Object obj)
throws Exception
- Specified by:
activateObject
in interface KeyedPoolableObjectFactory
- Throws:
Exception
destroyObject
public void destroyObject(Object key,
Object obj)
throws Exception
- Specified by:
destroyObject
in interface KeyedPoolableObjectFactory
- Throws:
Exception
makeObject
public Object makeObject(Object key)
throws Exception
- Specified by:
makeObject
in interface KeyedPoolableObjectFactory
- Throws:
Exception
passivateObject
public void passivateObject(Object key,
Object obj)
throws Exception
- Specified by:
passivateObject
in interface KeyedPoolableObjectFactory
- Throws:
Exception
validateObject
public boolean validateObject(Object key,
Object obj)
- Specified by:
validateObject
in interface KeyedPoolableObjectFactory
Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.