org.infinispan.util.concurrent
Class NotifyingFutureImpl
java.lang.Object
org.infinispan.util.concurrent.NotifyingFutureImpl
- All Implemented Interfaces:
- Future<Object>, NotifyingFuture<Object>, NotifyingNotifiableFuture<Object>
- Direct Known Subclasses:
- AggregatingNotifyingFutureImpl
public class NotifyingFutureImpl
- extends Object
- implements NotifyingNotifiableFuture<Object>
Constructs an instance of a NotifyingFuture
.
Typical usage:
Object retval = .... // do some work here NotifyingFuture nf = new NotifyingFutureImpl(retval);
rpcManager.broadcastRpcCommandInFuture(nf, command); return nf;
- Since:
- 4.0
- Author:
- Manik Surtani
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NotifyingFutureImpl
public NotifyingFutureImpl(Object actualReturnValue)
setNetworkFuture
public void setNetworkFuture(Future<Object> future)
- Specified by:
setNetworkFuture
in interface NotifyingNotifiableFuture<Object>
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancel
in interface Future<Object>
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interface Future<Object>
isDone
public boolean isDone()
- Specified by:
isDone
in interface Future<Object>
get
public Object get()
throws InterruptedException,
ExecutionException
- Specified by:
get
in interface Future<Object>
- Throws:
InterruptedException
ExecutionException
get
public Object get(long timeout,
TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
- Specified by:
get
in interface Future<Object>
- Throws:
InterruptedException
ExecutionException
TimeoutException
notifyDone
public void notifyDone()
- Specified by:
notifyDone
in interface NotifyingNotifiableFuture<Object>
attachListener
public NotifyingFuture<Object> attachListener(FutureListener<Object> objectFutureListener)
- Description copied from interface:
NotifyingFuture
- Attaches a listener and returns the same future instance, to allow for 'building'.
- Specified by:
attachListener
in interface NotifyingFuture<Object>
- Parameters:
objectFutureListener
- listener to attach
- Returns:
- the same future instance
Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.