Package org.apache.tomcat.jdbc.pool
Class ConnectionPool.PoolCleaner
- java.lang.Object
-
- java.util.TimerTask
-
- org.apache.tomcat.jdbc.pool.ConnectionPool.PoolCleaner
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- ConnectionPool
protected static class ConnectionPool.PoolCleaner extends java.util.TimerTaskA scheduled task that periodically checks for abandoned connections, validates idle connections, and resizes the idle pool according to the pool's configuration.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.ref.WeakReference<ConnectionPool>poolWeak reference to the connection pool being monitored.protected longsleepTimeSleep interval in milliseconds between cleaner runs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()voidstart()Starts the pool cleaner by registering it with the shared timer.voidstopRunning()Stops the pool cleaner by unregistering it from the shared timer.
-
-
-
Field Detail
-
pool
protected java.lang.ref.WeakReference<ConnectionPool> pool
Weak reference to the connection pool being monitored.
-
sleepTime
protected long sleepTime
Sleep interval in milliseconds between cleaner runs.
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Specified by:
runin classjava.util.TimerTask
-
start
public void start()
Starts the pool cleaner by registering it with the shared timer.
-
stopRunning
public void stopRunning()
Stops the pool cleaner by unregistering it from the shared timer.
-
-