public class NoOpFuture<E> extends java.lang.Object implements NotifyingNotifiableFuture<E>
Modifier and Type | Field and Description |
---|---|
private E |
returnValue |
Constructor and Description |
---|
NoOpFuture(E returnValue) |
Modifier and Type | Method and Description |
---|---|
NotifyingFuture<E> |
attachListener(FutureListener<E> eFutureListener)
Attaches a listener and returns the same future instance, to allow for 'building'.
|
boolean |
cancel(boolean b) |
E |
get() |
E |
get(long l,
java.util.concurrent.TimeUnit timeUnit) |
boolean |
isCancelled() |
boolean |
isDone() |
void |
notifyDone(E result)
Notify the listeners that the operation has finished.
|
void |
notifyException(java.lang.Throwable exception)
Notify the listeners that the operation has finished.
|
void |
setFuture(java.util.concurrent.Future<E> eFuture)
Setup the future which is wrapped by implementation of this interface.
|
private final E returnValue
public NoOpFuture(E returnValue)
public boolean cancel(boolean b)
cancel
in interface java.util.concurrent.Future<E>
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<E>
public boolean isDone()
isDone
in interface java.util.concurrent.Future<E>
public E get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get
in interface java.util.concurrent.Future<E>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public E get(long l, java.util.concurrent.TimeUnit timeUnit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
get
in interface java.util.concurrent.Future<E>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
public void notifyDone(E result)
NotifyingNotifiableFuture
notifyDone
in interface NotifyingNotifiableFuture<E>
public void notifyException(java.lang.Throwable exception)
NotifyingNotifiableFuture
notifyException
in interface NotifyingNotifiableFuture<E>
public void setFuture(java.util.concurrent.Future<E> eFuture)
NotifyingNotifiableFuture
setFuture
in interface NotifyingNotifiableFuture<E>
public NotifyingFuture<E> attachListener(FutureListener<E> eFutureListener)
NotifyingFuture
attachListener
in interface NotifyingFuture<E>
eFutureListener
- listener to attach