X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2FRemoteDOMRpcFuture.java;h=046b204121aa084de311f7f63f39f47d91909df2;hp=5df6e2bb0750f1f93d0286aad0cbe09004089168;hb=12fcdfe39aa26dcba7fd3bb4d4c68e3d02e65c51;hpb=a58c23b491f665e6d5449e97d430a7e15d1ecda6 diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteDOMRpcFuture.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteDOMRpcFuture.java index 5df6e2bb07..046b204121 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteDOMRpcFuture.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteDOMRpcFuture.java @@ -9,7 +9,6 @@ package org.opendaylight.controller.remote.rpc; import akka.dispatch.OnComplete; import com.google.common.base.Preconditions; -import com.google.common.base.Throwables; import com.google.common.util.concurrent.AbstractFuture; import com.google.common.util.concurrent.CheckedFuture; import java.util.concurrent.ExecutionException; @@ -26,18 +25,15 @@ import org.slf4j.LoggerFactory; import scala.concurrent.ExecutionContext; import scala.concurrent.Future; -/** - * @author tony - * - */ -class RemoteDOMRpcFuture extends AbstractFuture implements CheckedFuture { +final class RemoteDOMRpcFuture extends AbstractFuture + implements CheckedFuture { private static final Logger LOG = LoggerFactory.getLogger(RemoteDOMRpcFuture.class); private final QName rpcName; private RemoteDOMRpcFuture(final QName rpcName) { - this.rpcName = Preconditions.checkNotNull(rpcName,"rpcName"); + this.rpcName = Preconditions.checkNotNull(rpcName, "rpcName"); } public static RemoteDOMRpcFuture create(final QName rpcName) { @@ -60,7 +56,7 @@ class RemoteDOMRpcFuture extends AbstractFuture implements Checked } catch (final ExecutionException e) { throw mapException(e); } catch (final InterruptedException e) { - throw Throwables.propagate(e); + throw new RemoteDOMRpcException("Interruped while invoking RPC", e); } } @@ -71,22 +67,22 @@ class RemoteDOMRpcFuture extends AbstractFuture implements Checked } catch (final ExecutionException e) { throw mapException(e); } catch (final InterruptedException e) { - throw Throwables.propagate(e); + throw new RemoteDOMRpcException("Interruped while invoking RPC", e); } } - private DOMRpcException mapException(final ExecutionException e) { - final Throwable cause = e.getCause(); + private static DOMRpcException mapException(final ExecutionException ex) { + final Throwable cause = ex.getCause(); if (cause instanceof DOMRpcException) { return (DOMRpcException) cause; } - return new RemoteDOMRpcException("Exception during invoking RPC", e); + return new RemoteDOMRpcException("Exception during invoking RPC", ex); } private final class FutureUpdater extends OnComplete { @Override - public void onComplete(final Throwable error, final Object reply) throws Throwable { + public void onComplete(final Throwable error, final Object reply) { if (error != null) { RemoteDOMRpcFuture.this.failNow(error); } else if (reply instanceof RpcResponse) {