|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.eclipse.ocl.examples.eventmanager.framework.CleanupThread
public class CleanupThread
Observes a 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()
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
CleanupThread(java.lang.ref.ReferenceQueue<org.eclipse.emf.common.notify.Adapter> adaptersNoLongerStronglyReferenced,
EventManagerTableBased eventManager)
|
Method Summary | |
---|---|
void |
run()
|
void |
stopCleaner()
Indirectly but cleanly stops this thread. |
Methods inherited from class java.lang.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 |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CleanupThread(java.lang.ref.ReferenceQueue<org.eclipse.emf.common.notify.Adapter> adaptersNoLongerStronglyReferenced, EventManagerTableBased eventManager)
Method Detail |
---|
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |