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=d31a2fe3277694db6baf2a551ce5e3584670c399;hb=e294b955eb9f5d2111ff09a56a1e8caf3533403b;hp=72c6b1d75d99fec54f2914b2cc201e9a527910ed;hpb=67dd6d9e323157551345f89d3c00c8ebad068a11;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 72c6b1d75d..d31a2fe327 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 @@ -1,20 +1,72 @@ +/* + * Copyright (c) 2014 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.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}. + * */ -public interface RpcConsumerRegistry extends BindingAwareService { +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 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