Package org.apache.http.impl.conn.tsccm
Class RefQueueWorker
java.lang.Object
org.apache.http.impl.conn.tsccm.RefQueueWorker
- All Implemented Interfaces:
Runnable
public class RefQueueWorker extends Object implements Runnable
-
Field Summary
Fields Modifier and Type Field Description protected RefQueueHandlerrefHandlerThe handler for the references found.protected ReferenceQueue<?>refQueueThe reference queue to monitor.protected ThreadworkerThreadThe thread executing this handler. -
Constructor Summary
Constructors Constructor Description RefQueueWorker(ReferenceQueue<?> queue, RefQueueHandler handler)Instantiates a new worker to listen for lost connections. -
Method Summary
-
Field Details
-
refQueue
The reference queue to monitor. -
refHandler
The handler for the references found. -
workerThread
The thread executing this handler. This attribute is also used as a shutdown indicator.
-
-
Constructor Details
-
RefQueueWorker
Instantiates a new worker to listen for lost connections.- Parameters:
queue- the queue on which to wait for referenceshandler- the handler to pass the references to
-
-
Method Details
-
run
public void run()The main loop of this worker. If initialization succeeds, this method will only return aftershutdown(). Only one thread can execute the main loop at any time. -
shutdown
public void shutdown()Shuts down this worker. It can be re-started afterwards by another call torun(). -
toString
Obtains a description of this worker.
-