X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fapi%2FRpcConsumerRegistry.java;h=d6978d73d1e162f5b68473215c6205ccc3ddfd3d;hb=093728d9bc64609b5503ae9191a8cc1d0a937b79;hp=615acd3195c8a99ed5b5f372f53dee46d5faac7b;hpb=44c747db358bf0d49434d5f818121286b5928d4a;p=controller.git diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/RpcConsumerRegistry.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/RpcConsumerRegistry.java index 615acd3195..d6978d73d1 100644 --- a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/RpcConsumerRegistry.java +++ b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/RpcConsumerRegistry.java @@ -7,16 +7,20 @@ */ package org.opendaylight.controller.sal.binding.api; +import org.opendaylight.controller.md.sal.binding.api.BindingService; import org.opendaylight.yangtools.yang.binding.RpcService; /** * Provides access to registered Remote Procedure Call (RPC) service implementations. The RPCs are * defined in YANG models. + * *
* RPC implementations are registered using the {@link RpcProviderRegistry}. * + * @deprecated Use {@link org.opendaylight.mdsal.binding.api.RpcConsumerRegistry} instead */ -public interface RpcConsumerRegistry extends BindingAwareService { +@Deprecated +public interface RpcConsumerRegistry extends BindingAwareService, BindingService { /** * Returns an implementation of a requested RPC service. * @@ -38,29 +42,21 @@ public interface RpcConsumerRegistry extends BindingAwareService { * * The returned proxy is automatically updated with the most recent * registered implementation. - *
- * The generated RPC method APIs require implementors to return a {@link java.util.concurrent.Future Future} - * instance that wraps the {@link org.opendaylight.yangtools.yang.common.RpcResult RpcResult}. Since - * RPC methods may be implemented asynchronously, callers should avoid blocking on the - * {@link java.util.concurrent.Future Future} result. Instead, it is recommended to use - * {@link com.google.common.util.concurrent.JdkFutureAdapters#listenInPoolThread(java.util.concurrent.Future)} - * or {@link com.google.common.util.concurrent.JdkFutureAdapters#listenInPoolThread(java.util.concurrent.Future, java.util.concurrent.Executor)} - * to listen for Rpc Result. This will asynchronously listen for future result in executor and - * will not block current thread. * - *
+ * {@code * final Future* @param serviceInterface the interface of the RPC Service. Typically this is an interface generated * from a YANG model. * @return the proxy for the requested RPC service. This method never returns null.> future = someRpcService.someRpc( ... ); - * Futures.addCallback(JdkFutureAdapters.listenInThreadPool(future), new FutureCallback >() { + * Futures.addCallback(future, + * new FutureCallback >() { + * public void onSuccess(RpcResult result) { + * // process result ... + * } * - * public void onSuccess(RpcResult result) { - * // process result ... - * } + * public void onFailure(Throwable t) { + * // RPC failed + * } + * }); + * } * - * public void onFailure(Throwable t) { - * // RPC failed - * } - * ); - *