public class ValidatedResourceLimitingPool extends TraceableResourceLimitingPool
TraceableResourceLimitingPool.State, TraceableResourceLimitingPool.TraceException| Modifier and Type | Field and Description |
|---|---|
private boolean |
m_needsValidation
Used for communication between the get() and newPoolable() methods, only valid
within a single synchronized block.
|
DEFAULT_INSTRUMENTABLE_NAME, INSTRUMENT_BLOCKS_NAME, INSTRUMENT_CREATES_NAME, INSTRUMENT_DECOMMISSIONS_NAME, INSTRUMENT_GETS_NAME, INSTRUMENT_PUTS_NAME, INSTRUMENT_READY_SIZE_NAME, INSTRUMENT_SIZE_NAME, m_semaphore| Constructor and Description |
|---|
ValidatedResourceLimitingPool(org.apache.avalon.excalibur.pool.ObjectFactory factory,
int max,
boolean maxStrict,
boolean blocking,
long blockTimeout,
long trimInterval)
Creates a new ValidatedResourceLimitingPool
|
ValidatedResourceLimitingPool(org.apache.avalon.excalibur.pool.ObjectFactory factory,
int max,
boolean maxStrict,
boolean blocking,
long blockTimeout,
long trimInterval,
boolean trace)
Creates a new ValidatedResourceLimitingPool
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.avalon.excalibur.pool.Poolable |
get()
Gets a Poolable from the pool.
|
protected org.apache.avalon.excalibur.pool.Poolable |
newPoolable()
Create a new poolable instance by by calling the newInstance method
on the pool's ObjectFactory.
|
protected boolean |
validatePoolable(org.apache.avalon.excalibur.pool.Poolable poolable)
If the poolable implements Validatable, then its validate() method will be called to give
the poolable a chance to validate itself.
|
getState, put, removePoolabledispose, getChildInstrumentables, getInstrumentableName, getInstruments, getReadySize, getSize, permanentlyRemovePoolable, setInstrumentableName, trimenableLogging, getLogger, setupLogger, setupLogger, setupLoggerprivate boolean m_needsValidation
public ValidatedResourceLimitingPool(org.apache.avalon.excalibur.pool.ObjectFactory factory,
int max,
boolean maxStrict,
boolean blocking,
long blockTimeout,
long trimInterval,
boolean trace)
factory - The ObjectFactory which will be used to create new Poolables as needed by
the pool.max - Maximum number of Poolables which can be stored in the pool, 0 implies no limit.maxStrict - true if the pool should never allow more than max Poolable to be created.
Will cause an exception to be thrown if more than max Poolables are requested and blocking
is false.blocking - true if the pool should cause a thread calling get() to block when Poolables
are not currently available on the pool.blockTimeout - The maximum amount of time, in milliseconds, that a call to get() will
block before an exception is thrown. A value of 0 implies an indefinate wait.trimInterval - The minimum interval with which old unused poolables will be removed
from the pool. A value of 0 will cause the pool to never trim poolables.trace - True if tracing of gets is enabled for the pool.public ValidatedResourceLimitingPool(org.apache.avalon.excalibur.pool.ObjectFactory factory,
int max,
boolean maxStrict,
boolean blocking,
long blockTimeout,
long trimInterval)
factory - The ObjectFactory which will be used to create new Poolables as needed by
the pool.max - Maximum number of Poolables which can be stored in the pool, 0 implies no limit.maxStrict - true if the pool should never allow more than max Poolable to be created.
Will cause an exception to be thrown if more than max Poolables are requested and blocking
is false.blocking - true if the pool should cause a thread calling get() to block when Poolables
are not currently available on the pool.blockTimeout - The maximum amount of time, in milliseconds, that a call to get() will
block before an exception is thrown. A value of 0 implies an indefinate wait.trimInterval - The minimum interval with which old unused poolables will be removed
from the pool. A value of 0 will cause the pool to never trim poolables.public org.apache.avalon.excalibur.pool.Poolable get()
throws java.lang.Exception
get in interface org.apache.avalon.excalibur.pool.Poolget in class TraceableResourceLimitingPooljava.lang.Exception - An exception may be thrown as described above or if there is an exception
thrown by the ObjectFactory's newInstance() method.protected org.apache.avalon.excalibur.pool.Poolable newPoolable()
throws java.lang.Exception
newPoolable in class InstrumentedResourceLimitingPooljava.lang.Exceptionprotected boolean validatePoolable(org.apache.avalon.excalibur.pool.Poolable poolable)
throws java.lang.Exception
poolable - The Poolable to be validatedjava.lang.Exception