Package io.joynr.proxy
Class Future<T>
- java.lang.Object
-
- io.joynr.proxy.Future<T>
-
public class Future<T> extends Object
-
-
Constructor Summary
Constructors Constructor Description Future()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget()This is a blocking call which waits until the request finishes/an error occurs.Tget(long timeoutMs)This is a blocking call which waits until the request finishes/an error occurs/or times out.RequestStatusgetStatus()voidonFailure(JoynrException newException)Terminates the future in errorvoidonSuccess(T result)Resolves the future using the given resultvoidresolve(Object... outParameters)
-
-
-
Method Detail
-
get
public T get(long timeoutMs) throws InterruptedException, JoynrWaitExpiredException, ApplicationException, JoynrRuntimeException
This is a blocking call which waits until the request finishes/an error occurs/or times out. If the request finishes successfully, it retrieves the return value for the request if one exists, otherwise a JoynrException is thrown.- Parameters:
timeoutMs- The maximum number of milliseconds to wait before this request times out- Returns:
- the result of the request
- Throws:
InterruptedException- if the thread is interrupted.JoynrWaitExpiredException- if timeout_ms expiresApplicationException- if the request failed with a ApplicationExceptionJoynrRuntimeException- if the request failed with a JoynrRuntimeException
-
get
public T get() throws InterruptedException, JoynrWaitExpiredException, ApplicationException, JoynrRuntimeException
This is a blocking call which waits until the request finishes/an error occurs. If the request finishes successfully, it retrieves the return value for the request if one exists, otherwise a JoynrException is thrown.- Returns:
- the result of the request
- Throws:
InterruptedException- if the thread is interrupted.JoynrWaitExpiredException- if timeout_ms expiresApplicationException- if the request failed with a ApplicationExceptionJoynrRuntimeException- if the request failed with a JoynrRuntimeException
-
getStatus
public RequestStatus getStatus()
-
onSuccess
public void onSuccess(T result)
Resolves the future using the given result- Parameters:
result- the result of the asynchronous call
-
onFailure
public void onFailure(JoynrException newException)
Terminates the future in error- Parameters:
newException- that caused the failure
-
resolve
public void resolve(Object... outParameters)
-
-