org.eclipse.ecf.core.util
Interface IAsyncResult

All Known Implementing Classes:
AsyncResult

public interface IAsyncResult


Method Summary
 void clear()
          Clear this AsyncResult.
 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()
           
 

Method Detail

get

java.lang.Object get()
                     throws java.lang.InterruptedException,
                            java.lang.reflect.InvocationTargetException
Get the underlying result. Block until result is available.

Returns:
Object that is result
Throws:
java.lang.InterruptedException - thrown if waiting is interrupted
java.lang.reflect.InvocationTargetException - thrown if exception was thrown by execution

get

java.lang.Object get(long msecs)
                     throws TimeoutException,
                            java.lang.InterruptedException,
                            java.lang.reflect.InvocationTargetException
Get the underlying result with limited wait time. Behaves similarly to Object.wait(), but only waits msecs (ms) before throwing TimeoutException

Parameters:
msecs - to wait before timing out
Returns:
Object that is result
Throws:
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 execution

getException

java.lang.reflect.InvocationTargetException getException()
Get the InvocationTargetException that occured during invocation. If null, no exception was thrown

Returns:
InvocationTargetException if an exception occurred. Null if no exception has occurred

isReady

boolean isReady()
Returns:
true if result has been set or exception has occurred, false if not.

peek

java.lang.Object peek()
Returns:
Object result that has been set or null if has not been set

clear

void clear()
Clear this AsyncResult. Clears both the result Object and the InvocationTargetException (if set)