Class ConnectionPool.PoolCleaner

java.lang.Object
java.util.TimerTask
org.apache.tomcat.jdbc.pool.ConnectionPool.PoolCleaner
All Implemented Interfaces:
Runnable
Enclosing class:
ConnectionPool

protected static class ConnectionPool.PoolCleaner extends TimerTask
A scheduled task that periodically checks for abandoned connections, validates idle connections, and resizes the idle pool according to the pool's configuration.
  • Field Details

    • pool

      protected WeakReference<ConnectionPool> pool
      Weak reference to the connection pool being monitored.
    • sleepTime

      protected long sleepTime
      Sleep interval in milliseconds between cleaner runs.
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
      Specified by:
      run in class 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.