org.infinispan.util.concurrent
Class NotifyingFutureImpl

java.lang.Object
  extended by org.infinispan.util.concurrent.NotifyingFutureImpl
All Implemented Interfaces:
Future<Object>, NotifyingFuture<Object>, NotifyingNotifiableFuture<Object>
Direct Known Subclasses:
AggregatingNotifyingFutureBuilder, 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

Constructor Summary
NotifyingFutureImpl(Object actualReturnValue)
           
 
Method Summary
 NotifyingFuture<Object> attachListener(FutureListener<Object> objectFutureListener)
          Attaches a listener and returns the same future instance, to allow for 'building'.
 boolean cancel(boolean mayInterruptIfRunning)
           
 Object get()
           
 Object get(long timeout, TimeUnit unit)
           
 boolean isCancelled()
           
 boolean isDone()
           
 void notifyDone()
           
 void setNetworkFuture(Future<Object> future)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotifyingFutureImpl

public NotifyingFutureImpl(Object actualReturnValue)
Method Detail

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 © 2012 JBoss, a division of Red Hat. All Rights Reserved.