public class HeliumRpcProviderRegistry extends Object implements RpcProviderRegistry
Constructor and Description |
---|
HeliumRpcProviderRegistry(RpcConsumerRegistry consumerRegistry,
BindingDOMRpcProviderServiceAdapter providerAdapter) |
Modifier and Type | Method and Description |
---|---|
<T extends org.opendaylight.yangtools.yang.binding.RpcService> |
addRoutedRpcImplementation(Class<T> type,
T impl)
Registers an implementation of the given routed RPC service interface.
|
<T extends org.opendaylight.yangtools.yang.binding.RpcService> |
addRpcImplementation(Class<T> type,
T impl)
Registers a global implementation of the provided RPC service interface.
|
<T extends org.opendaylight.yangtools.yang.binding.RpcService> |
getRpcService(Class<T> type)
Returns an implementation of a requested RPC service.
|
<L extends RouteChangeListener<RpcContextIdentifier,org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?>>> |
registerRouteChangeListener(L listener) |
public HeliumRpcProviderRegistry(RpcConsumerRegistry consumerRegistry, BindingDOMRpcProviderServiceAdapter providerAdapter)
public <T extends org.opendaylight.yangtools.yang.binding.RpcService> BindingAwareBroker.RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> type, T impl) throws IllegalStateException
RpcProviderRegistry
See the class
documentation for information and example on
how to use routed RPCs.
addRoutedRpcImplementation
in interface RpcProviderRegistry
type
- the YANG-generated interface of the RPC Service for which to register.impl
- the implementation instance to register.BindingAwareBroker.RpcRegistration.close()
should be called to unregister the implementation
and all previously registered paths when no longer needed.IllegalStateException
- if the supplied RPC interface is not a routed RPC type.public <T extends org.opendaylight.yangtools.yang.binding.RpcService> BindingAwareBroker.RpcRegistration<T> addRpcImplementation(Class<T> type, T impl) throws IllegalStateException
RpcProviderRegistry
addRpcImplementation
in interface RpcProviderRegistry
type
- the YANG-generated interface of the RPC Service for which to register.impl
- "the implementation of the RPC service interface.BindingAwareBroker.RpcRegistration.close()
.IllegalStateException
- if the supplied RPC interface is a routed RPC type.public <T extends org.opendaylight.yangtools.yang.binding.RpcService> T getRpcService(Class<T> type)
RpcConsumerRegistry
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:
IllegalStateException
.IllegalArgumentException
is thrown.
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
}
});
getRpcService
in interface RpcConsumerRegistry
type
- the interface of the RPC Service. Typically this is an interface generated
from a YANG model.public <L extends RouteChangeListener<RpcContextIdentifier,org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?>>> org.opendaylight.yangtools.concepts.ListenerRegistration<L> registerRouteChangeListener(L listener)
registerRouteChangeListener
in interface RouteChangePublisher<RpcContextIdentifier,org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?>>
Copyright © 2019 OpenDaylight. All rights reserved.