Package mondrian.util
Class SlotFuture<V>
- java.lang.Object
-
- mondrian.util.SlotFuture<V>
-
-
Constructor Summary
Constructors Constructor Description SlotFuture()Creates a SlotFuture.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)voidfail(Throwable throwable)Writes a throwable into the slot, indicating that the task has failed.Vget()Vget(long timeout, TimeUnit unit)booleanisCancelled()booleanisDone()voidput(V value)Writes a value into the slot, indicating that the task has completed successfully.StringtoString()
-
-
-
Method Detail
-
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>
-
get
public V get() throws ExecutionException, InterruptedException
- 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
public void put(V value)
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
public void fail(Throwable throwable)
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
-
-