org.simantics.databoard.method
Interface MethodInterface.AsyncResult

All Known Implementing Classes:
AsyncResultImpl
Enclosing interface:
MethodInterface

public static interface MethodInterface.AsyncResult


Method Summary
 java.lang.Object getExecutionError()
           
 InvokeException getInvokeException()
           
 java.lang.Object getResponse()
           
 MethodInterface.AsyncRequestStatus getStatus()
           
 void setListener(MethodInterface.InvokeListener listener)
          Add a listener.
 java.lang.Object waitForResponse()
           
 java.lang.Object waitForResponse(long timeout, java.util.concurrent.TimeUnit unit)
           
 

Method Detail

setListener

void setListener(MethodInterface.InvokeListener listener)
Add a listener. It will be notified immediately if the response is available.

Parameters:
listener - (listener may not block) or null to remove listener

getResponse

java.lang.Object getResponse()
Returns:
response or null

getExecutionError

java.lang.Object getExecutionError()

getInvokeException

InvokeException getInvokeException()

getStatus

MethodInterface.AsyncRequestStatus getStatus()

waitForResponse

java.lang.Object waitForResponse()
                                 throws InvokeException,
                                        MethodInterface.ExecutionError,
                                        java.lang.InterruptedException
Returns:
response
Throws:
java.lang.InterruptedException - block was canceled
InvokeException - network error, e.g. IOException of MethodNotSupportedException
MethodInterface.ExecutionError - error that occured while executing the method

waitForResponse

java.lang.Object waitForResponse(long timeout,
                                 java.util.concurrent.TimeUnit unit)
                                 throws InvokeException,
                                        MethodInterface.ExecutionError,
                                        java.lang.InterruptedException
Returns:
response
Throws:
java.lang.InterruptedException
InvokeException - network error, e.g. IOException of MethodNotSupportedException
MethodInterface.ExecutionError - error that occured while executing the method