/* * 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; /** * 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 */ @Deprecated public interface RpcConsumerRegistry extends BindingAwareService, BindingService { /** * 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 serviceInterface); }