public class NotifyingFutureImpl<T> extends BaseNotifyingFuture<T> implements NotifyingNotifiableFuture<T>
NotifyingFuture
.
Typical usage:
Object retval = ... // do some work here
NotifyingFuture nf = new NotifyingFutureImpl();
rpcManager.broadcastRpcCommandInFuture(nf, command);
return nf;
Constructor and Description |
---|
NotifyingFutureImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
Future<T> |
getFuture() |
boolean |
isCancelled() |
boolean |
isDone() |
void |
notifyDone(T result)
Notify the listeners that the operation has finished.
|
void |
notifyException(Throwable exception)
Notify the listeners that the operation has finished.
|
void |
setFuture(Future<T> future)
Setup the future which is wrapped by implementation of this interface.
|
attachListener, fireListeners
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
attachListener
public void setFuture(Future<T> future)
NotifyingNotifiableFuture
setFuture
in interface NotifyingNotifiableFuture<T>
public Future<T> getFuture() throws InterruptedException
InterruptedException
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<T>
public T get() throws InterruptedException, ExecutionException
get
in interface Future<T>
InterruptedException
ExecutionException
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<T>
InterruptedException
ExecutionException
TimeoutException
public void notifyDone(T result)
NotifyingNotifiableFuture
notifyDone
in interface NotifyingNotifiableFuture<T>
public void notifyException(Throwable exception)
NotifyingNotifiableFuture
notifyException
in interface NotifyingNotifiableFuture<T>
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.