Class EventDrivenRemoteFuture<T>
java.lang.Object
org.openspaces.remoting.EventDrivenRemoteFuture<T>
- All Implemented Interfaces:
Future<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface Future
Future.State -
Constructor Summary
ConstructorsConstructorDescriptionEventDrivenRemoteFuture(GigaSpace gigaSpace, SpaceRemotingEntry remotingEntry) -
Method Summary
Modifier and TypeMethodDescriptionbooleancancel(boolean mayInterruptIfRunning) Attempts to cancel execution of this task.get()Waits if necessary for the computation to complete, and then retrieves its result.Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.booleanReturnstrueif this task was cancelled before it completed normally.booleanisDone()Returnstrueif this task completed.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Future
exceptionNow, resultNow, state
-
Constructor Details
-
EventDrivenRemoteFuture
-
-
Method Details
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) Attempts to cancel execution of this task. This attempt will fail if the task has already completed, already been cancelled, or could not be cancelled for some other reason. If successful, and this task has not started whencancelis called, this task should never run. -
isCancelled
public boolean isCancelled()Returnstrueif this task was cancelled before it completed normally.- Specified by:
isCancelledin interfaceFuture<T>- Returns:
trueif task was cancelled before it completed
-
isDone
-
get
Waits if necessary for the computation to complete, and then retrieves its result.- Specified by:
getin interfaceFuture<T>- Returns:
- the computed result
- Throws:
CancellationException- if the computation was cancelledExecutionException- if the computation threw an exceptionInterruptedException- if the current thread was interrupted while waiting
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.- Specified by:
getin interfaceFuture<T>- Parameters:
timeout- the maximum time to waitunit- the time unit of the timeout argument- Returns:
- the computed result
- Throws:
CancellationException- if the computation was cancelledExecutionException- if the computation threw an exceptionInterruptedException- if the current thread was interrupted while waitingTimeoutException- if the wait timed out
-