EvictionTimer

Provides a shared idle object eviction timer for all pools. <p> This class is currently implemented using {@link ScheduledThreadPoolExecutor}. This implementation may change in any future release. This class keeps track of how many pools are using it. If no pools are using the timer, it is cancelled. This prevents a thread being left running which, in application server environments, can lead to memory leads and/or prevent applications from shutting down or reloading cleanly. </p> <p> This class has package scope to prevent its inclusion in the pool public API. The class declaration below should *not* be changed to public. </p> <p> This class is intended to be thread-safe. </p>

Members

Functions

toString
string toString()

Static functions

cancel
void cancel(BaseGenericObjectPool.Evictor evictor, Duration timeout)

Remove the specified eviction task from the timer.

schedule
void schedule(BaseGenericObjectPool.Evictor task, long delay, long period)

Add the specified eviction task to the timer. Tasks that are added with a call to this method *must* call {@link #cancel(TimerTask)} to cancel the task to prevent memory and/or thread leaks in application server environments.

Meta