2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.sal.binding.api;
10 import org.opendaylight.controller.md.sal.binding.api.BindingService;
11 import org.opendaylight.yangtools.yang.binding.RpcService;
14 * Provides access to registered Remote Procedure Call (RPC) service implementations. The RPCs are
15 * defined in YANG models.
18 * RPC implementations are registered using the {@link RpcProviderRegistry}.
20 * @deprecated Use {@link org.opendaylight.mdsal.binding.api.RpcConsumerRegistry} instead
23 public interface RpcConsumerRegistry extends BindingAwareService, BindingService {
25 * Returns an implementation of a requested RPC service.
28 * The returned instance is not an actual implementation of the RPC service
29 * interface, but a proxy implementation of the interface that forwards to
30 * an actual implementation, if any.
33 * The following describes the behavior of the proxy when invoking RPC methods:
35 * <li>If an actual implementation is registered with the MD-SAL, all invocations are
36 * forwarded to the registered implementation.</li>
37 * <li>If no actual implementation is registered, all invocations will fail by
38 * throwing {@link IllegalStateException}.</li>
39 * <li>Prior to invoking the actual implementation, the method arguments are are validated.
40 * If any are invalid, an {@link IllegalArgumentException} is thrown.
43 * The returned proxy is automatically updated with the most recent
44 * registered implementation.
47 * final Future<RpcResult<SomeRpcOutput>> future = someRpcService.someRpc( ... );
48 * Futures.addCallback(future,
49 * new FutureCallback<RpcResult<SomeRpcOutput>>() {
50 * public void onSuccess(RpcResult<SomeRpcOutput> result) {
51 * // process result ...
54 * public void onFailure(Throwable t) {
60 * @param serviceInterface the interface of the RPC Service. Typically this is an interface generated
62 * @return the proxy for the requested RPC service. This method never returns null.
64 <T extends RpcService> T getRpcService(Class<T> serviceInterface);