public abstract class TransformingFuture<T,V>
extends java.lang.Object
implements com.scaleoutsoftware.soss.client.da.ListenableFuture<T>
Future
methods to an existing
Future
instance while providing a callback (transform(V)
) to complete
processing when the operation completes. The callback typically transforms the type of the
delegate future into a future of a new type.Modifier | Constructor and Description |
---|---|
protected |
TransformingFuture(com.scaleoutsoftware.soss.client.da.ListenableFuture<V> delegateFuture) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(com.scaleoutsoftware.soss.client.da.FutureListener<T> callback) |
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
void |
removeListener(com.scaleoutsoftware.soss.client.da.FutureListener<T> callback) |
protected abstract T |
transform(V value) |
protected TransformingFuture(com.scaleoutsoftware.soss.client.da.ListenableFuture<V> delegateFuture)
public boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface java.util.concurrent.Future<T>
public T get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get
in interface java.util.concurrent.Future<T>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public T get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
get
in interface java.util.concurrent.Future<T>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<T>
public boolean isDone()
isDone
in interface java.util.concurrent.Future<T>
public void addListener(com.scaleoutsoftware.soss.client.da.FutureListener<T> callback)
addListener
in interface com.scaleoutsoftware.soss.client.da.ListenableFuture<T>