|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ecf.core.util.AsynchResult
public class AsynchResult
Class to represent asynchronous result (aka Future)
Field Summary | |
---|---|
protected java.lang.reflect.InvocationTargetException |
resultException
|
protected boolean |
resultReady
|
protected java.lang.Object |
resultValue
|
Constructor Summary | |
---|---|
AsynchResult()
|
Method Summary | |
---|---|
void |
clear()
Clear this AsynchResult. |
protected java.lang.Object |
doGet()
|
java.lang.Object |
get()
Get the underlying result. |
java.lang.Object |
get(long msecs)
Get the underlying result with limited wait time. |
java.lang.reflect.InvocationTargetException |
getException()
Get the InvocationTargetException that occured during invocation. |
boolean |
isReady()
|
java.lang.Object |
peek()
|
void |
set(java.lang.Object newValue)
Set the result to a newValue. |
void |
setException(java.lang.Throwable ex)
Set exception to ex |
java.lang.Runnable |
setter(ICallable function)
Set the underlying function call that will return a result asynchronously |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object resultValue
protected boolean resultReady
protected java.lang.reflect.InvocationTargetException resultException
Constructor Detail |
---|
public AsynchResult()
Method Detail |
---|
public java.lang.Runnable setter(ICallable function)
function
- the ICallable
to be called
protected java.lang.Object doGet() throws java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
public java.lang.Object get() throws java.lang.InterruptedException, java.lang.reflect.InvocationTargetException
java.lang.InterruptedException
- thrown if waiting is interrupted
java.lang.reflect.InvocationTargetException
- thrown if exception was thrown by executionpublic java.lang.Object get(long msecs) throws TimeoutException, java.lang.InterruptedException, java.lang.reflect.InvocationTargetException
Object.wait()
, but only waits msecs (ms) before throwing
TimeoutException
msecs
- to wait before timing out
TimeoutException
- thrown if msecs elapse before a result is available
java.lang.InterruptedException
- thrown if waiting is interrupted
java.lang.reflect.InvocationTargetException
- thrown if exception was thrown by executionpublic void set(java.lang.Object newValue)
newValue
- to set the result topublic void setException(java.lang.Throwable ex)
ex
- the Throwable to set the exception topublic java.lang.reflect.InvocationTargetException getException()
InvocationTargetException.getCause()
. Null if no
exception has occurredpublic boolean isReady()
public java.lang.Object peek()
public void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |