public abstract class ResourcePoolFactory
extends java.lang.Object
A Factory for ResourcePools. ResourcePoolFactories may manage resources (usually threads that perform maintenance tasks) that are shared by all pools that they create. Clients who require a large number of pools may wish to create their own factory instances rather than using the shared instance to control the degree of resource (Thread) sharing among pools.
Factories should (and the default implementation does) be careful to ensure that factories keep resources open only while there are active ResourcePools that they have created.
Subclasses must mark all methods synchronized so that clients may reliably use shared factories to do stuff like...
synchronized (factory) { factory.setMin(8); factory.setMax(24); ResourcePool rp = factory.createPool(); }
Constructor and Description |
---|
ResourcePoolFactory() |
Modifier and Type | Method and Description |
---|---|
static ResourcePoolFactory |
createInstance() |
static ResourcePoolFactory |
createInstance(com.mchange.v2.async.AsynchronousRunner taskRunner,
com.mchange.v2.async.RunnableQueue asyncEventQueue,
java.util.Timer cullTimer)
Any or all of these arguments can be null -- any unspecified resources
will be created and cleaned up internally.
|
static ResourcePoolFactory |
createInstance(int num_task_threads) |
static ResourcePoolFactory |
createInstance(com.mchange.v2.async.Queuable taskRunnerEventQueue,
java.util.Timer cullTimer) |
abstract ResourcePool |
createPool(ResourcePool.Manager mgr) |
abstract int |
getAcquisitionRetryAttempts() |
abstract int |
getAcquisitionRetryDelay() |
abstract boolean |
getBreakOnAcquisitionFailure() |
abstract boolean |
getDebugStoreCheckoutStackTrace() |
abstract long |
getDestroyOverdueResourceTime() |
abstract long |
getExcessResourceMaxIdleTime() |
abstract long |
getExpirationEnforcementDelay() |
abstract long |
getIdleResourceTestPeriod() |
abstract int |
getIncrement() |
abstract int |
getMax() |
abstract int |
getMin() |
abstract long |
getResourceMaxAge() |
abstract long |
getResourceMaxIdleTime() |
static ResourcePoolFactory |
getSharedInstance() |
abstract int |
getStart() |
abstract void |
setAcquisitionRetryAttempts(int retry_attempts) |
abstract void |
setAcquisitionRetryDelay(int retry_delay) |
abstract void |
setBreakOnAcquisitionFailure(boolean b) |
abstract void |
setDebugStoreCheckoutStackTrace(boolean debug_store_checkout_stacktrace) |
abstract void |
setDestroyOverdueResourceTime(long millis) |
abstract void |
setExcessResourceMaxIdleTime(long millis) |
abstract void |
setExpirationEnforcementDelay(long millis) |
abstract void |
setIdleResourceTestPeriod(long test_period) |
abstract void |
setIncrement(int max) |
abstract void |
setMax(int max) |
abstract void |
setMin(int min) |
abstract void |
setResourceMaxAge(long millis) |
abstract void |
setResourceMaxIdleTime(long millis) |
abstract void |
setStart(int start) |
public static ResourcePoolFactory getSharedInstance() throws ResourcePoolException
ResourcePoolException
public static ResourcePoolFactory createInstance()
public static ResourcePoolFactory createInstance(int num_task_threads)
public static ResourcePoolFactory createInstance(com.mchange.v2.async.AsynchronousRunner taskRunner, com.mchange.v2.async.RunnableQueue asyncEventQueue, java.util.Timer cullTimer)
public static ResourcePoolFactory createInstance(com.mchange.v2.async.Queuable taskRunnerEventQueue, java.util.Timer cullTimer)
public abstract void setMin(int min) throws ResourcePoolException
ResourcePoolException
public abstract int getMin() throws ResourcePoolException
ResourcePoolException
public abstract void setMax(int max) throws ResourcePoolException
ResourcePoolException
public abstract int getStart() throws ResourcePoolException
ResourcePoolException
public abstract void setStart(int start) throws ResourcePoolException
ResourcePoolException
public abstract int getMax() throws ResourcePoolException
ResourcePoolException
public abstract void setIncrement(int max) throws ResourcePoolException
ResourcePoolException
public abstract int getIncrement() throws ResourcePoolException
ResourcePoolException
public abstract void setAcquisitionRetryAttempts(int retry_attempts) throws ResourcePoolException
ResourcePoolException
public abstract int getAcquisitionRetryAttempts() throws ResourcePoolException
ResourcePoolException
public abstract void setAcquisitionRetryDelay(int retry_delay) throws ResourcePoolException
ResourcePoolException
public abstract int getAcquisitionRetryDelay() throws ResourcePoolException
ResourcePoolException
public abstract void setIdleResourceTestPeriod(long test_period) throws ResourcePoolException
ResourcePoolException
public abstract long getIdleResourceTestPeriod() throws ResourcePoolException
ResourcePoolException
public abstract void setResourceMaxAge(long millis) throws ResourcePoolException
ResourcePoolException
public abstract long getResourceMaxAge() throws ResourcePoolException
ResourcePoolException
public abstract void setResourceMaxIdleTime(long millis) throws ResourcePoolException
ResourcePoolException
public abstract long getResourceMaxIdleTime() throws ResourcePoolException
ResourcePoolException
public abstract void setExcessResourceMaxIdleTime(long millis) throws ResourcePoolException
ResourcePoolException
public abstract long getExcessResourceMaxIdleTime() throws ResourcePoolException
ResourcePoolException
public abstract long getDestroyOverdueResourceTime() throws ResourcePoolException
ResourcePoolException
public abstract void setDestroyOverdueResourceTime(long millis) throws ResourcePoolException
ResourcePoolException
public abstract void setExpirationEnforcementDelay(long millis) throws ResourcePoolException
ResourcePoolException
public abstract long getExpirationEnforcementDelay() throws ResourcePoolException
ResourcePoolException
public abstract void setBreakOnAcquisitionFailure(boolean b) throws ResourcePoolException
ResourcePoolException
public abstract boolean getBreakOnAcquisitionFailure() throws ResourcePoolException
ResourcePoolException
public abstract void setDebugStoreCheckoutStackTrace(boolean debug_store_checkout_stacktrace) throws ResourcePoolException
ResourcePoolException
public abstract boolean getDebugStoreCheckoutStackTrace() throws ResourcePoolException
ResourcePoolException
public abstract ResourcePool createPool(ResourcePool.Manager mgr) throws ResourcePoolException
ResourcePoolException