Interface RpcConsumerRegistry
-
- All Superinterfaces:
BindingAwareService
,BindingService
- All Known Subinterfaces:
BindingAwareBroker.ConsumerContext
,BindingAwareBroker.ProviderContext
,RpcProviderRegistry
- All Known Implementing Classes:
AbstractBindingSalConsumerInstance
,AbstractBindingSalProviderInstance
,BindingDOMRpcServiceAdapter
,HeliumRpcProviderRegistry
,RootBindingAwareBroker
,RootBindingAwareBroker.RootSalInstance
@Deprecated(forRemoval=true) public interface RpcConsumerRegistry extends BindingAwareService, BindingService
Deprecated, for removal: This API element is subject to removal in a future version.UseRpcConsumerRegistry
insteadProvides access to registered Remote Procedure Call (RPC) service implementations. The RPCs are defined in YANG models.RPC implementations are registered using the
RpcProviderRegistry
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description <T extends RpcService>
TgetRpcService(Class<T> serviceInterface)
Deprecated, for removal: This API element is subject to removal in a future version.Returns an implementation of a requested RPC service.
-
-
-
Method Detail
-
getRpcService
<T extends RpcService> T getRpcService(Class<T> serviceInterface)
Deprecated, for removal: This API element is subject to removal in a future version.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:
- If an actual implementation is registered with the MD-SAL, all invocations are forwarded to the registered implementation.
- If no actual implementation is registered, all invocations will fail by
throwing
IllegalStateException
. - Prior to invoking the actual implementation, the method arguments are are validated.
If any are invalid, an
IllegalArgumentException
is thrown.
The returned proxy is automatically updated with the most recent registered implementation.
final Future<RpcResult<SomeRpcOutput>> future = someRpcService.someRpc( ... ); Futures.addCallback(future, new FutureCallback<RpcResult<SomeRpcOutput>>() { public void onSuccess(RpcResult<SomeRpcOutput> result) { // process result ... } public void onFailure(Throwable t) { // RPC failed } });
- Parameters:
serviceInterface
- the interface of the RPC Service. Typically this is an interface generated from a YANG model.- Returns:
- the proxy for the requested RPC service. This method never returns null.
-
-