Example usage for com.google.common.util.concurrent ForwardingListenableFuture ForwardingListenableFuture

List of usage examples for com.google.common.util.concurrent ForwardingListenableFuture ForwardingListenableFuture

Introduction

In this page you can find the example usage for com.google.common.util.concurrent ForwardingListenableFuture ForwardingListenableFuture.

Prototype

protected ForwardingListenableFuture() 

Source Link

Document

Constructor for use by subclasses.

Usage

From source file:com.yahoo.yqlplus.engine.internal.scope.ExecutionScoper.java

public <T> ListenableFuture<T> scopeCallbacks(final ListenableFuture<T> callback) {
    final ScopedObjects scope = getScope();
    return new ForwardingListenableFuture<T>() {
        @Override//  w  w w.  j a  va 2  s  .c o  m
        protected ListenableFuture<T> delegate() {
            return callback;
        }

        @Override
        public void addListener(Runnable listener, Executor exec) {
            super.addListener(listener, scope(exec, scope));
        }
    };
}