X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-common-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fcommon%2Futil%2FFutures.java;h=3384e8fb20037d0e9da1e020bf9ae2e744cc24a8;hb=059605a27e8a1280cefa8186a9057144bc281518;hp=c942159f49ea0c929784e62004bcb661e6ab6cb7;hpb=738d46bed116293e3e42171ad2035ab805b0b2be;p=controller.git diff --git a/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Futures.java b/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Futures.java index c942159f49..3384e8fb20 100644 --- a/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Futures.java +++ b/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Futures.java @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ package org.opendaylight.controller.sal.common.util; import java.util.concurrent.ExecutionException; @@ -5,47 +12,52 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +/** + * @deprecated Use {@link com.google.common.util.concurrent.Futures} instead. + */ +@Deprecated public class Futures { - private Futures(){} - - public static Future immediateFuture(T result) { - return new ImmediateFuture(result); - } - - private static class ImmediateFuture implements Future { - - private final T result; - - public ImmediateFuture(T result) { - this.result = result; - } - - @Override - public boolean cancel(boolean mayInterruptIfRunning) { - return false; - } - - @Override - public boolean isCancelled() { - return false; - } - - @Override - public boolean isDone() { - return true; - } - - @Override - public T get() throws InterruptedException, ExecutionException { - return result; - } - - @Override - public T get(long timeout, TimeUnit unit) throws InterruptedException, - ExecutionException, TimeoutException { - return result; - } - - } + private Futures() { + } + + public static Future immediateFuture(T result) { + return new ImmediateFuture(result); + } + + private static class ImmediateFuture implements Future { + + private final T result; + + public ImmediateFuture(T result) { + this.result = result; + } + + @Override + public boolean cancel(boolean mayInterruptIfRunning) { + return false; + } + + @Override + public boolean isCancelled() { + return false; + } + + @Override + public boolean isDone() { + return true; + } + + @Override + public T get() throws InterruptedException, ExecutionException { + return result; + } + + @Override + public T get(long timeout, TimeUnit unit) throws InterruptedException, + ExecutionException, TimeoutException { + return result; + } + + } }