Package org.graffiti.util
Class DelayThread
java.lang.Object
java.lang.Thread
org.graffiti.util.DelayThread
- All Implemented Interfaces:
Runnable
public class DelayThread extends Thread
This delay thread will help prevent too many calls in short time by catching
the calls and only giving the last stored event after a short period of time
to the actual event handler using a callback mechanism If it has delivered
the event it will trigger "wait" and halt the thread A new event will then
wake up the thread.
- Author:
- matthiak
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DelayThread.DelayedCallback
This callback interface is used by the DelayThread Implementing classes can set the method to be calledNested 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
-
Constructor Summary
Constructors Constructor Description DelayThread(DelayThread.DelayedCallback callback)
-
Method Summary
Modifier and Type Method Description void
run()
void
setAttributeEvent(AttributeEvent e)
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield