public class ThirdEventThread
extends java.lang.Thread
The thread has be waked up using wakeup()
method. After a time defined by the ThirdEventThread.ThirdEventWidget
, the
thread asks to the ThirdEventThread.ThirdEventWidget
to send the event.
At any moment the thread can stop event timeout calling the method goToSleep()
.
Modifier and Type | Class and Description |
---|---|
static interface |
ThirdEventThread.ThirdEventWidget
The
ThirdEventThread requires an implementation of ThirdEventThread.ThirdEventWidget to send to event after a
sleep period. |
Constructor and Description |
---|
ThirdEventThread(ThirdEventThread.ThirdEventWidget widget,
boolean infinite)
Creates a ThirdEventThread for the ThirdEventWidget.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes this thread stopping it.
|
void |
goToSleep()
Sleeps the thread.
|
boolean |
isSendingThirdEvent()
Returns true when a call to
wakeup() has been performed whereas a call to goToSleep() not. |
void |
run() |
void |
wakeup()
Wakes up the thread: it will waits during waiting period before send the third event.
|
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 ThirdEventThread(ThirdEventThread.ThirdEventWidget widget, boolean infinite)
widget
- the widget which sends the third event.infinite
- true to send the third event indifinitively until goToSleep()
is called.public void dispose()
public void wakeup()
public void goToSleep()
public boolean isSendingThirdEvent()
wakeup()
has been performed whereas a call to goToSleep()
not.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread