Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.infinispan.commons.util.concurrent;
 
 import java.util.Set;
Constructs an instance of a org.infinispan.util.concurrent.NotifyingFuture.

Typical usage:

Object retval = .... // do some work here NotifyingFuture nf = new NotifyingFutureImpl(retval); rpcManager.broadcastRpcCommandInFuture(nf, command); return nf;

Author(s):
Manik Surtani
Since:
4.0
public class NotifyingFutureImpl<T> extends BaseNotifyingFuture<T> implements NotifyingNotifiableFuture<T>{
   final T actualReturnValue;
   volatile Future<T> ioFuture;
   //TODO revisit if volatile needed
   public NotifyingFutureImpl(T actualReturnValue) {
      this. = actualReturnValue;
   }
   @Override
   public void setNetworkFuture(Future<T> future) {
      this. = future;
   }
   @Override
   public boolean cancel(boolean mayInterruptIfRunning) {
      return .cancel(mayInterruptIfRunning);
   }
   @Override
   public boolean isCancelled() {
      return .isCancelled();
   }
   @Override
   public boolean isDone() {
      return .isDone();
   }
   @Override
   public T get() throws InterruptedExceptionExecutionException {
      if (!) {
         .get();
      }
      return ;
   }
   @Override
   public T get(long timeoutTimeUnit unitthrows InterruptedExceptionExecutionExceptionjava.util.concurrent.TimeoutException {
      if (!) {
         .get(timeoutunit);
      }
      return ;
   }
New to GrepCode? Check out our FAQ X