public abstract class AbstractBindingSalConsumerInstance<N extends NotificationService,R extends RpcConsumerRegistry> extends Object implements RpcConsumerRegistry, NotificationService
Modifier | Constructor and Description |
---|---|
protected |
AbstractBindingSalConsumerInstance(R rpcRegistry,
N notificationBroker) |
Modifier and Type | Method and Description |
---|---|
protected N |
getNotificationBroker() |
protected N |
getNotificationBrokerChecked() |
protected R |
getRpcRegistry() |
protected R |
getRpcRegistryChecked() |
<T extends org.opendaylight.yangtools.yang.binding.RpcService> |
getRpcService(Class<T> module)
Returns an implementation of a requested RPC service.
|
<T extends org.opendaylight.yangtools.yang.binding.Notification> |
registerNotificationListener(Class<T> notificationType,
NotificationListener<T> listener)
Registers a generic listener implementation for a specified notification type.
|
org.opendaylight.yangtools.concepts.ListenerRegistration<org.opendaylight.yangtools.yang.binding.NotificationListener> |
registerNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener)
Registers a listener which implements a YANG-generated notification interface derived from
NotificationListener . |
protected final R getRpcRegistry()
protected final N getNotificationBroker()
protected final R getRpcRegistryChecked()
protected final N getNotificationBrokerChecked()
public <T extends org.opendaylight.yangtools.yang.binding.RpcService> T getRpcService(Class<T> module)
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
module
- the interface of the RPC Service. Typically this is an interface generated
from a YANG model.public <T extends org.opendaylight.yangtools.yang.binding.Notification> org.opendaylight.yangtools.concepts.ListenerRegistration<NotificationListener<T>> registerNotificationListener(Class<T> notificationType, NotificationListener<T> listener)
NotificationService
registerNotificationListener
in interface NotificationService
notificationType
- the YANG-generated interface of the notification type.listener
- the listener implementation that will receive notifications.ListenerRegistration
instance that should be used to unregister the listener
by invoking the ListenerRegistration.close()
method when no longer needed.public org.opendaylight.yangtools.concepts.ListenerRegistration<org.opendaylight.yangtools.yang.binding.NotificationListener> registerNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener)
NotificationService
NotificationListener
.
The listener is registered for all notifications present in the implemented interface.registerNotificationListener
in interface NotificationService
listener
- the listener implementation that will receive notifications.ListenerRegistration
instance that should be used to unregister the listener
by invoking the ListenerRegistration.close()
method when no longer needed.Copyright © 2019 OpenDaylight. All rights reserved.