org.eclipse.actf.ui.util.timer
Class WeakSyncTimer

java.lang.Object
  extended by java.lang.Thread
      extended by org.eclipse.actf.ui.util.timer.WeakSyncTimer
All Implemented Interfaces:
Runnable

public class WeakSyncTimer
extends Thread

WeakSyncTimer is a timer running on a thread. It has instances of SyncEventListener which extends Runnable and has a interval time. SyncEventListener will be executed at the interval until the instance is disposed by the garbage collector.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 void addEventListener(SyncEventListener listener)
          Add an event listener to the timer.
static WeakSyncTimer getTimer()
           
 void removeEventListener(SyncEventListener listener)
          Remove an event explicitly.
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

addEventListener

public void addEventListener(SyncEventListener listener)
Add an event listener to the timer.

Parameters:
listener - the event listener to be executed.

removeEventListener

public void removeEventListener(SyncEventListener listener)
Remove an event explicitly.

Parameters:
listener - the event listener to be removed.

getTimer

public static WeakSyncTimer getTimer()
Returns:
the singleton instance of the timer.