Class HttpIdleConnectionReaper.ReaperThread

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    HttpIdleConnectionReaper

    private class HttpIdleConnectionReaper.ReaperThread
    extends java.lang.Thread
    Thread that reaps idle and expired connections.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean shutdown
      Indicates if the thread is shut down.
      private java.util.concurrent.CountDownLatch shutdownLatch
      CountDownLatch used when stopping the thread.
      private java.util.concurrent.CountDownLatch startupLatch
      CountDownLatch used when starting the thread.
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ReaperThread()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()  
      (package private) void waitForStart​(long millis)
      Tells the reaper thread the maximum time to wait before starting.
      (package private) void waitForStop​(long millis)
      Tells the reaper thread the maximum time to wait before stopping.
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • shutdown

        private volatile boolean shutdown
        Indicates if the thread is shut down.
      • shutdownLatch

        private final java.util.concurrent.CountDownLatch shutdownLatch
        CountDownLatch used when stopping the thread.
      • startupLatch

        private final java.util.concurrent.CountDownLatch startupLatch
        CountDownLatch used when starting the thread.
    • Constructor Detail

      • ReaperThread

        private ReaperThread()
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • waitForStart

        void waitForStart​(long millis)
                   throws java.lang.InterruptedException
        Tells the reaper thread the maximum time to wait before starting.
        Parameters:
        millis - The maximum time to wait before starting the thread.
        Throws:
        java.lang.InterruptedException - If the current thread was interrupted.
      • waitForStop

        void waitForStop​(long millis)
                  throws java.lang.InterruptedException
        Tells the reaper thread the maximum time to wait before stopping.
        Parameters:
        millis - The maximum time to wait before stopping the thread.
        Throws:
        java.lang.InterruptedException - If the current thread was interrupted.