public class RefQueueWorker
extends java.lang.Object
implements java.lang.Runnable
Reference
s can be
queued
automatically by the garbage collector.
If that feature is used, a daemon thread should be executing
this worker. It will pick up the queued references and pass them
on to a handler for appropriate processing.Modifier and Type | Field and Description |
---|---|
protected RefQueueHandler |
refHandler
Deprecated.
The handler for the references found.
|
protected java.lang.ref.ReferenceQueue |
refQueue
Deprecated.
The reference queue to monitor.
|
protected java.lang.Thread |
workerThread
Deprecated.
The thread executing this handler.
|
Constructor and Description |
---|
RefQueueWorker(java.lang.ref.ReferenceQueue queue,
RefQueueHandler handler)
Deprecated.
Instantiates a new worker to listen for lost connections.
|
Modifier and Type | Method and Description |
---|---|
void |
run()
Deprecated.
The main loop of this worker.
|
void |
shutdown()
Deprecated.
Shuts down this worker.
|
java.lang.String |
toString()
Deprecated.
Obtains a description of this worker.
|
protected final java.lang.ref.ReferenceQueue refQueue
protected final RefQueueHandler refHandler
protected volatile java.lang.Thread workerThread
public RefQueueWorker(java.lang.ref.ReferenceQueue queue, RefQueueHandler handler)
queue
- the queue on which to wait for referenceshandler
- the handler to pass the references topublic void run()
shutdown()
. Only one thread can
execute the main loop at any time.run
in interface java.lang.Runnable
public void shutdown()
run()
.public java.lang.String toString()
toString
in class java.lang.Object