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
attachListener
public void setFuture(Future<T> future)
NotifyingNotifiableFuture
setFuture
in interface NotifyingNotifiableFuture<T>
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
public boolean isDone()
public T get()
public void notifyDone(T result)
NotifyingNotifiableFuture
notifyDone
in interface NotifyingNotifiableFuture<T>
public void notifyException(Throwable exception)
NotifyingNotifiableFuture
notifyException
in interface NotifyingNotifiableFuture<T>
Copyright © 2015 JBoss, a division of Red Hat. All rights reserved.