org.infinispan.util.concurrent
Class DeferredReturnFuture<V>

java.lang.Object
  extended by org.infinispan.util.concurrent.DeferredReturnFuture<V>
All Implemented Interfaces:
Future<V>, NotifyingFuture<V>, NotifyingNotifiableFuture<V>

public class DeferredReturnFuture<V>
extends Object
implements NotifyingNotifiableFuture<V>

This is a notifying and notifiable future whose return value is not known at construction time. Instead, the return value comes from the result of the operation called in the Callable or Runnable.

Since:
5.0
Author:
Galder ZamarreƱo

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

Constructor Detail

DeferredReturnFuture

public DeferredReturnFuture()
Method Detail

get

public V get()
      throws InterruptedException,
             ExecutionException
Specified by:
get in interface Future<V>
Throws:
InterruptedException
ExecutionException

get

public V get(long timeout,
             TimeUnit unit)
      throws InterruptedException,
             ExecutionException,
             TimeoutException
Specified by:
get in interface Future<V>
Throws:
InterruptedException
ExecutionException
TimeoutException

notifyDone

public void notifyDone()
Specified by:
notifyDone in interface NotifyingNotifiableFuture<V>

setNetworkFuture

public void setNetworkFuture(Future<V> future)
Specified by:
setNetworkFuture in interface NotifyingNotifiableFuture<V>

attachListener

public NotifyingFuture<V> attachListener(FutureListener<V> 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<V>
Parameters:
objectFutureListener - listener to attach
Returns:
the same future instance

cancel

public boolean cancel(boolean mayInterruptIfRunning)
Specified by:
cancel in interface Future<V>

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface Future<V>

isDone

public boolean isDone()
Specified by:
isDone in interface Future<V>

-->

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