public class CleanupThread
extends java.lang.Thread
reference queue
and removes Adapter
s
from it. It weakly references an EventManagerTableBased
. When a
reference to an adapter was added to the queue and henceforth removed by this
thread, this means that the adapter is no longer strongly referenced. A
EventManagerTableBased.deregister(Reference)
is issued to clean up
after the adapter.
When the event manager
becomes eligible for
garbage collection, its EventManagerTableBased.finalize()
method
stops this thread by calling stopCleaner()
.
Constructor and Description |
---|
CleanupThread(java.lang.ref.ReferenceQueue<org.eclipse.emf.common.notify.Adapter> adaptersNoLongerStronglyReferenced,
EventManagerTableBased eventManager) |
Modifier and Type | Method and Description |
---|---|
void |
run() |
void |
stopCleaner()
Indirectly but cleanly stops this thread.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public CleanupThread(java.lang.ref.ReferenceQueue<org.eclipse.emf.common.notify.Adapter> adaptersNoLongerStronglyReferenced, EventManagerTableBased eventManager)
public void stopCleaner()
stopThreadAdapter
field which was the only strong reference to
the adapter held by it. The weak reference in stopThreadMarker
will therefore be enqueued which serves as the stop marker, causing the
run()
loop to terminate.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread