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=33b384a94c652d0ffe196e3319393413407e5cad;hpb=94d0d20b41d64bb6696c2a573ec367fcfddc44e9;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 33b384a94c..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,21 +7,59 @@ */ package org.opendaylight.controller.sal.binding.api; +import org.opendaylight.controller.md.sal.binding.api.BindingService; import org.opendaylight.yangtools.yang.binding.RpcService; /** - * Base interface defining contract for retrieving MD-SAL - * version of RpcServices - * + * 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 a session specific instance (implementation) of requested - * YANG module implentation / service provided by consumer. - * - * @param service - * Broker service - * @return Session specific implementation of service + * Returns an implementation of a requested RPC service. + * + *

+ * The returned instance is not an actual implementation of the RPC service + * interface, but a proxy implementation of the interface that forwards to + * an actual implementation, if any. + *

+ * + * The following describes the behavior of the proxy when invoking RPC methods: + *

+ * + * The returned proxy is automatically updated with the most recent + * registered implementation. + * + * {@code + * final Future> future = someRpcService.someRpc( ... ); + * Futures.addCallback(future, + * new FutureCallback>() { + * public void onSuccess(RpcResult result) { + * // process result ... + * } + * + * public void onFailure(Throwable t) { + * // RPC failed + * } + * }); + * } + * + * @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. */ - T getRpcService(Class module); + T getRpcService(Class serviceInterface); }