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
-
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
mayInterruptIfRunning
parameter is ignored. -
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceFuture<V>
-
isDone
public boolean isDone() -
get
- Specified by:
get
in interfaceFuture<V>
- Throws:
ExecutionException
InterruptedException
-
get
public V get(long timeout, TimeUnit unit) throws ExecutionException, InterruptedException, TimeoutException - Specified by:
get
in interfaceFuture<V>
- Throws:
ExecutionException
InterruptedException
TimeoutException
-
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
-