com.jthreadkit.pool
Class AbstractResourcePool
java.lang.Object
|
+--com.jthreadkit.pool.AbstractResourcePool
- All Implemented Interfaces:
- AccessibleLock, ResourcePool
- Direct Known Subclasses:
- ClassA
- public abstract class AbstractResourcePool
- extends Object
- implements ResourcePool
setLowHighMax
public void setLowHighMax(int newLowWaterMark,
int newHighWaterMark,
int newMaxCount)
throws IllegalArgumentException
- Specified by:
setLowHighMax in interface ResourcePool
getMaxCount
public int getMaxCount()
- Specified by:
getMaxCount in interface ResourcePool
setMaxCount
public int setMaxCount(int requestedNewMax)
- Specified by:
setMaxCount in interface ResourcePool
getLowWaterMark
public int getLowWaterMark()
- Specified by:
getLowWaterMark in interface ResourcePool
setLowWaterMark
public int setLowWaterMark(int newLevel)
- Specified by:
setLowWaterMark in interface ResourcePool
getHighWaterMark
public int getHighWaterMark()
- Specified by:
getHighWaterMark in interface ResourcePool
setHighWaterMark
public int setHighWaterMark(int newLevel)
- Specified by:
setHighWaterMark in interface ResourcePool
getCreateResourceDelay
public long getCreateResourceDelay()
- Specified by:
getCreateResourceDelay in interface ResourcePool
setCreateResourceDelay
public void setCreateResourceDelay(long msDelay)
- Specified by:
setCreateResourceDelay in interface ResourcePool
getCreateResourceInterval
public long getCreateResourceInterval()
- Specified by:
getCreateResourceInterval in interface ResourcePool
setCreateResourceInterval
public void setCreateResourceInterval(long msDelay)
- Specified by:
setCreateResourceInterval in interface ResourcePool
getCreateResourceOnDemandDelay
public long getCreateResourceOnDemandDelay()
- Specified by:
getCreateResourceOnDemandDelay in interface ResourcePool
setCreateResourceOnDemandDelay
public void setCreateResourceOnDemandDelay(long msDelay)
- Specified by:
setCreateResourceOnDemandDelay in interface ResourcePool
getDestroyResourceDelay
public long getDestroyResourceDelay()
- Specified by:
getDestroyResourceDelay in interface ResourcePool
setDestroyResourceDelay
public void setDestroyResourceDelay(long msDelay)
- Specified by:
setDestroyResourceDelay in interface ResourcePool
getDestroyResourceInterval
public long getDestroyResourceInterval()
- Specified by:
getDestroyResourceInterval in interface ResourcePool
setDestroyResourceInterval
public void setDestroyResourceInterval(long msDelay)
- Specified by:
setDestroyResourceInterval in interface ResourcePool
getLockObject
public Object getLockObject()
- Description copied from interface:
AccessibleLock
- Returns the reference to the object that is synchronized on
by other methods in the implementing class. This reference
is not permitted to change after construction, so this method
can be called once and the reference saved.
This reference can be used in synchronized blocks
to keep other threads from sneaking in between methods calls
like this:
|
obj = //...
synchronized ( obj.getLockObject() ) {
obj.methodA();
obj.methodB();
}
|
- Specified by:
getLockObject in interface AccessibleLock
- Following copied from interface:
com.jthreadkit.AccessibleLock
- Returns:
- the object used to lock on to control concurrent access.
addConfigChangeListener
public boolean addConfigChangeListener(ConfigChangeListener listener)
- Specified by:
addConfigChangeListener in interface ResourcePool
removeConfigChangeListener
public boolean removeConfigChangeListener(ConfigChangeListener listener)
- Specified by:
removeConfigChangeListener in interface ResourcePool
initiateShutdown
public void initiateShutdown(long msDelayBeforeHardball)
- Specified by:
initiateShutdown in interface ResourcePool
waitUntilShutdown
public boolean waitUntilShutdown(long msTimeout)
throws InterruptedException
- Specified by:
waitUntilShutdown in interface ResourcePool
© Copyright 2000-2001 Programix Incorporated. All rights reserved. JThreadKit home