|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.sys.MessageThreadTask
This class is used to execute a method within the System Message Thread (which is needed to do certain operations on certain operating systems).
To use it you simply override doTask(). This method will get called in the System Message Thread when the execute() method of the MessageThreadTask is executed.
If execute() is called when the system is already in the Message Thread, then the doTask() method is called immediately. Other wise, the current Coroutine is halted and a CallBack is requested, which will then execute doTask(). After doTask() has been executed the current Coroutine continues and returns the value returned by doTask().
| Field Summary | |
int |
timeout
This is the number of milliseconds to wait before the callBack() completes. |
| Constructor Summary | |
MessageThreadTask()
|
|
MessageThreadTask(Window w)
|
|
| Method Summary | |
void |
callBack(Object data)
|
protected abstract boolean |
doTask(Object data)
This is the only thing to override. |
boolean |
execute(Object data)
Execute the doTask() method in a System Thread. |
boolean |
execute(Object data,
boolean alwaysExecuteNow)
Execute the doTask() method in a System Thread or in the current thread - depending on the value of alwaysExecuteNow. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
public int timeout
| Constructor Detail |
public MessageThreadTask(Window w)
public MessageThreadTask()
| Method Detail |
protected abstract boolean doTask(Object data)
public final void callBack(Object data)
callBack in interface CallBackpublic final boolean execute(Object data)
data - The data to be passed to doTask().
public final boolean execute(Object data,
boolean alwaysExecuteNow)
data - The data to be passed to doTask().alwaysExecuteNow - If this is true then doTask() will always be executed in the current thread.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||