|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ijsberg.iglu.util.execution.Executable
public abstract class Executable
Subclasses implement a piece of code that should be executed in a special way, such as:
new Executable(){protected Object execute(){System.out.println("this message is printed asynchronously");return null;}}.executeAsync();
| Constructor Summary | |
|---|---|
Executable()
|
|
| Method Summary | |
|---|---|
protected abstract Object |
execute()
Implements code to be executed. |
void |
executeAsync()
Executes asynchronously. |
void |
executeAsyncDelayed(long delay)
Executes after |
void |
executeAsyncTimed(long timeout)
Executes asynchronously. |
Object |
executeDelayed(long delay)
|
Object |
executeTimed(long timeout)
Executes synchronously. |
Throwable |
getExecutionException()
|
Thread |
getExecutionThread()
|
Object |
getReturnValue()
|
void |
interrupt()
Tries to interrupt execution. |
boolean |
isFinished()
|
void |
run()
Used to invoke executable asynchronously. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Executable()
| Method Detail |
|---|
public void run()
run in interface Runnablepublic void executeAsync()
public void executeAsyncTimed(long timeout)
timeout - timeout value in millisecondspublic void executeAsyncDelayed(long delay)
delay -
public Object executeTimed(long timeout)
throws TimeOutException,
InterruptedException,
Throwable
timeout - timeout value in milliseconds
TimeOutException - in case the call is timed out
InterruptedException - if execution was interrupted before timeout
Throwable - in case the executable throws
public Object executeDelayed(long delay)
throws TimeOutException,
Throwable
delay -
TimeOutException
Throwable
protected abstract Object execute()
throws Throwable
Throwablepublic void interrupt()
public Throwable getExecutionException()
public boolean isFinished()
public Thread getExecutionThread()
public Object getReturnValue()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||