|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.aplu.util.JRunner
public class JRunner
A helper class in order to execute a method in a separate thread and to get a notification callback when the thread terminates. (Simple version of SwingWorker.)
Constructor Summary | |
---|---|
JRunner(java.lang.Object exposedObj)
Create a JRunner instance with given reference to a class instance. |
Method Summary | |
---|---|
void |
cancel()
Continue the halted thread and block until the thread is dead. |
void |
cancel(long millis)
Continue the halted thread and wait for the thread to die at most the given time (in ms). |
void |
join()
Block until the internal thread dies. |
void |
join(long millis)
Wait for the internal thread to die at most the given time (in ms). |
void |
resume()
Continue the halted thread. |
void |
run(java.lang.String methodName)
Create a thread and invoke the parameterless method with given name. |
boolean |
waitIfRequested()
Halt temporarily the execution of the internal thread if it was requested by calling waitRequest() and block until cancel() or resume() is called. |
void |
waitRequest()
Set the waitRequest flag. |
void |
waitRequest(boolean wait)
Clear or set the waitRequest flag. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JRunner(java.lang.Object exposedObj)
Method Detail |
---|
public void run(java.lang.String methodName)
void done(String methodName)
, done() is called with its
corresponding methodName. done() is invoked by the event dispatch
thread (EDT), so that Swing methods may be called directly.void killed(String methodName)
, killed() is called with its
corresponding methodName. killed() is invoked by the event dispatch
thread (EDT), so that Swing methods may be called directly.
public void join(long millis)
join()
public void join()
join(long)
public boolean waitIfRequested()
waitRequest()
,
cancel()
,
resume()
public void resume()
waitRequest()
public void cancel(long millis)
cancel()
,
waitRequest()
public void cancel()
cancel(long)
,
waitRequest()
public void waitRequest()
waitIfRequested()
public void waitRequest(boolean wait)
waitIfRequested()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |