|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.util.Task
public abstract class Task
A method call that is executed in a separate thread. If the method throws an exception, it is wrapped in a RuntimeException.
| Field Summary | |
|---|---|
protected java.lang.Object |
result
The result, if any. |
protected boolean |
stop
A flag indicating the get() method has been called. |
| Constructor Summary | |
|---|---|
Task()
|
|
| Method Summary | |
|---|---|
abstract void |
call()
The method to be implemented. |
Task |
execute()
Start the thread. |
java.lang.Object |
get()
Calling this method will set the stop flag and wait until the thread is stopped. |
java.lang.Exception |
getException()
Get the exception that was thrown in the call (if any). |
void |
run()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected volatile boolean stop
protected java.lang.Object result
| Constructor Detail |
|---|
public Task()
| Method Detail |
|---|
public abstract void call()
throws java.lang.Exception
java.lang.Exception - any exception is wrapped in a RuntimeExceptionpublic void run()
run in interface java.lang.Runnablepublic Task execute()
public java.lang.Object get()
java.lang.RuntimeException - if an exception in the method call occurspublic java.lang.Exception getException()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||