Modifier and Type | Field and Description |
---|---|
protected Object |
result
The result, if any.
|
protected boolean |
stop
A flag indicating the get() method has been called.
|
Constructor and Description |
---|
Task() |
Modifier and Type | Method and Description |
---|---|
abstract void |
call()
The method to be implemented.
|
Task |
execute()
Start the thread.
|
Object |
get()
Calling this method will set the stop flag and wait until the thread is
stopped.
|
Exception |
getException()
Get the exception that was thrown in the call (if any).
|
void |
run() |
protected volatile boolean stop
protected Object result
public abstract void call() throws Exception
Exception
- any exception is wrapped in a RuntimeExceptionpublic Task execute()
public Object get()
RuntimeException
- if an exception in the method call occurspublic Exception getException()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.