Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.infinispan.commons.util.concurrent;
 
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.

Author(s):
Galder ZamarreƱo
Since:
5.0
public class DeferredReturnFuture<V> implements NotifyingNotifiableFuture<V> {
   private final NotifyingFutureImpl<ObjectdelegateFuture = new NotifyingFutureImpl<Object>(null);
   @Override
   @SuppressWarnings("unchecked")
   public V get() throws InterruptedExceptionExecutionException {
      // Return the network's future result
      return (V) ..get();
   }
   @Override
   @SuppressWarnings("unchecked")
   public V get(long timeoutTimeUnit unitthrows InterruptedExceptionExecutionExceptionjava.util.concurrent.TimeoutException {
      return (V) ..get(timeoutunit);
   }
   @Override
   public void notifyDone() {
   }
   @Override
   @SuppressWarnings("unchecked")
   public void setNetworkFuture(Future<V> future) {
   }
   @Override
   @SuppressWarnings("unchecked")
   public NotifyingFuture<V> attachListener(FutureListener<V> objectFutureListener) {
      return (NotifyingFuture<V>) .attachListener((FutureListener<Object>) objectFutureListener);
   }
   @Override
   public boolean cancel(boolean mayInterruptIfRunning) {
      return .cancel(mayInterruptIfRunning);
   }
   @Override
   public boolean isCancelled() {
      return .isCancelled();
   }
   @Override
   public boolean isDone() {
      return .isDone();
   }
New to GrepCode? Check out our FAQ X