Class HttpIdleConnectionReaper.ReaperThread
- java.lang.Object
-
- java.lang.Thread
-
- org.restlet.ext.httpclient.internal.HttpIdleConnectionReaper.ReaperThread
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- HttpIdleConnectionReaper
private class HttpIdleConnectionReaper.ReaperThread extends java.lang.ThreadThread that reaps idle and expired connections.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanshutdownIndicates if the thread is shut down.private java.util.concurrent.CountDownLatchshutdownLatchCountDownLatch used when stopping the thread.private java.util.concurrent.CountDownLatchstartupLatchCountDownLatch used when starting the thread.
-
Constructor Summary
Constructors Modifier Constructor Description privateReaperThread()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()(package private) voidwaitForStart(long millis)Tells the reaper thread the maximum time to wait before starting.(package private) voidwaitForStop(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
-
-
-
-
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.
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
waitForStart
void waitForStart(long millis) throws java.lang.InterruptedExceptionTells 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.InterruptedExceptionTells 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.
-
-