Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.infinispan.commons.util.concurrent;
 
 
Receives a java.util.concurrent.Future and exposes it as an NotifyingFuture.

Author(s):
Mircea Markus
Since:
5.2
public class NotifyingFutureAdaptor<T> extends BaseNotifyingFuture<T> {
   private static Log log = LogFactory.getLog(NotifyingFutureAdaptor.class);
   private volatile Future<T> actual;
   public void setActual(Future<T> actual) {
      this. = actual;
   }
   @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 {
      T result = .get();
      .tracef("Actual future completed with result %s"result);
      return result;
   }
   @Override
   public T get(long timeoutTimeUnit unitthrows InterruptedExceptionExecutionExceptionTimeoutException {
      return .get(timeoutunit);
   }
New to GrepCode? Check out our FAQ X