org.infinispan.util.concurrent
Interface NotifyingFuture<T>

All Superinterfaces:
Future<T>
All Known Subinterfaces:
NotifyingNotifiableFuture<T>
All Known Implementing Classes:
AbstractInProcessNotifyingFuture, AggregatingNotifyingFutureBuilder, AggregatingNotifyingFutureImpl, DefaultExecutorService.DistributedRunnableFuture, DeferredReturnFuture, NoOpFuture, NotifyingFutureImpl, NotifyingFutureImpl

public interface NotifyingFuture<T>
extends Future<T>

A sub-interface of a Future, that allows for listeners to be attached so that observers can be notified of when the future completes.

See FutureListener for more details.

attachListener(FutureListener) returns the same future instance, which is useful for 'building' a future. E.g.,

Future f = cache.clearAsync().attachListener(new MyCustomListener());

Since:
4.0
Author:
Manik Surtani

Method Summary
 NotifyingFuture<T> attachListener(FutureListener<T> listener)
          Attaches a listener and returns the same future instance, to allow for 'building'.
 
Methods inherited from interface java.util.concurrent.Future
cancel, get, get, isCancelled, isDone
 

Method Detail

attachListener

NotifyingFuture<T> attachListener(FutureListener<T> listener)
Attaches a listener and returns the same future instance, to allow for 'building'.

Parameters:
listener - listener to attach
Returns:
the same future instance

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.