Package mondrian.util
Class SlotFuture<V>
java.lang.Object
mondrian.util.SlotFuture<V>
- All Implemented Interfaces:
Future<V>
Implementation of
Future that completes
when a thread writes a value (or an exception) into a slot.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SlotFuture
public SlotFuture()Creates a SlotFuture.
-
-
Method Details
-
toString
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) The SlotFuture does not know which thread is computing the result and therefore the
mayInterruptIfRunningparameter is ignored. -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<V>
-
isDone
public boolean isDone() -
get
- Specified by:
getin interfaceFuture<V>- Throws:
ExecutionExceptionInterruptedException
-
get
public V get(long timeout, TimeUnit unit) throws ExecutionException, InterruptedException, TimeoutException - Specified by:
getin interfaceFuture<V>- Throws:
ExecutionExceptionInterruptedExceptionTimeoutException
-
put
Writes a value into the slot, indicating that the task has completed successfully.- Parameters:
value- Value to yield as the result of the computation- Throws:
IllegalArgumentException- if put, fail or cancel has already been invoked on this future
-
fail
Writes a throwable into the slot, indicating that the task has failed.- Parameters:
throwable- Exception that aborted the computation- Throws:
IllegalArgumentException- if put, fail or cancel has already been invoked on this future
-