|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ecf.core.util.AsyncResult
public class AsyncResult
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 | |
|---|---|
AsyncResult()
|
|
| Method Summary | |
|---|---|
void |
clear()
Clear this AsyncResult. |
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 AsyncResult()
| 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
IAsyncResult
get in interface IAsyncResultjava.lang.InterruptedException - thrown if waiting is interrupted
java.lang.reflect.InvocationTargetException - thrown if exception was thrown by execution
public java.lang.Object get(long msecs)
throws TimeoutException,
java.lang.InterruptedException,
java.lang.reflect.InvocationTargetException
IAsyncResultObject.wait(), but only waits msecs (ms) before throwing
TimeoutException
get in interface IAsyncResultmsecs - 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()
IAsyncResult
getException in interface IAsyncResultNull if no
exception has occurredpublic boolean isReady()
isReady in interface IAsyncResultpublic java.lang.Object peek()
peek in interface IAsyncResultpublic void clear()
IAsyncResult
clear in interface IAsyncResult
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||