Class CompletionListenerFuture

java.lang.Object
javax.cache.integration.CompletionListenerFuture
All Implemented Interfaces:
Future<Void>, CompletionListener

public class CompletionListenerFuture extends Object implements CompletionListener, Future<Void>
A CompletionListenerFuture is a CompletionListener implementation that supports being used as a Future.

For example:


 //create a completion future to use to wait for loadAll
 CompletionListenerFuture future = new CompletionListenerFuture();
 
 //load the values for the set of keys, replacing those that may already exist
 //in the cache
 cache.loadAll(keys, true, future);
 
 //wait for the cache to load the keys
 future.get();
 

A CompletionListenerFuture may only be used once. Attempts to use an instance multiple times, as part of multiple asynchronous calls will result in an IllegalStateException being raised.

Since:
1.0