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 boolean
cancel(boolean mayInterruptIfRunning)
void
fail(Throwable throwable)
Writes a throwable into the slot, indicating that the task has failed.V
get()
V
get(long timeout, TimeUnit unit)
boolean
isCancelled()
boolean
isDone()
void
put(V value)
Writes a value into the slot, indicating that the task has completed successfully.String
toString()
-
-
-
Method Detail
-
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>
-
get
public V get() throws ExecutionException, InterruptedException
- 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
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
-
-