2 * Copyright © 2016, 2017 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.netvirt.elan.l2gw.utils;
10 import com.google.common.util.concurrent.FutureCallback;
11 import com.google.common.util.concurrent.SettableFuture;
13 public class SettableFutureCallback<T> implements FutureCallback<T> {
15 private final SettableFuture<T> settableFuture;
17 public SettableFutureCallback(SettableFuture<T> settableFuture) {
18 this.settableFuture = settableFuture;
22 public void onSuccess(T objT) {
23 settableFuture.set(objT);
27 public void onFailure(Throwable throwable) {
28 settableFuture.setException(throwable);