public abstract class AbstractBindingSalProviderInstance<N extends NotificationProviderService,R extends RpcProviderRegistry> extends AbstractBindingSalConsumerInstance<N,R> implements RpcProviderRegistry, NotificationProviderService
NotificationProviderService.NotificationInterestListener
Constructor and Description |
---|
AbstractBindingSalProviderInstance(R rpcRegistry,
N notificationBroker) |
Modifier and Type | Method and Description |
---|---|
<T extends org.opendaylight.yangtools.yang.binding.RpcService> |
addRoutedRpcImplementation(Class<T> type,
T implementation)
Registers an implementation of the given routed RPC service interface.
|
<T extends org.opendaylight.yangtools.yang.binding.RpcService> |
addRpcImplementation(Class<T> type,
T implementation)
Registers a global implementation of the provided RPC service interface.
|
void |
publish(org.opendaylight.yangtools.yang.binding.Notification notification)
Publishes a notification and notifies subscribed listeners.
|
void |
publish(org.opendaylight.yangtools.yang.binding.Notification notification,
ExecutorService service)
Publishes a notification and notifies subscribed listeners.
|
org.opendaylight.yangtools.concepts.ListenerRegistration<NotificationProviderService.NotificationInterestListener> |
registerInterestListener(NotificationProviderService.NotificationInterestListener interestListener)
Registers a listener to be notified about notification subscriptions.
|
<L extends RouteChangeListener<RpcContextIdentifier,org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?>>> |
registerRouteChangeListener(L listener) |
getNotificationBroker, getNotificationBrokerChecked, getRpcRegistry, getRpcRegistryChecked, getRpcService, registerNotificationListener, registerNotificationListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRpcService
registerNotificationListener, registerNotificationListener
public <T extends org.opendaylight.yangtools.yang.binding.RpcService> BindingAwareBroker.RpcRegistration<T> addRpcImplementation(Class<T> type, T implementation) throws IllegalStateException
RpcProviderRegistry
addRpcImplementation
in interface RpcProviderRegistry
type
- the YANG-generated interface of the RPC Service for which to register.implementation
- "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> BindingAwareBroker.RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> type, T implementation) 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.implementation
- 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 void publish(org.opendaylight.yangtools.yang.binding.Notification notification)
NotificationPublishService
Note: This call will block when the default executor is saturated and the notification queue for this executor is full.
publish
in interface NotificationPublishService<org.opendaylight.yangtools.yang.binding.Notification>
publish
in interface NotificationProviderService
notification
- the notification to publish.public void publish(org.opendaylight.yangtools.yang.binding.Notification notification, ExecutorService service)
NotificationPublishService
Note: Use only if necessary. Consider using
NotificationPublishService.publish(Object)
for most use-cases.
By using this method you could customize execution policy of listeners present inside process (e.g. using single-threaded executor or even same-thread executor delivery.
This executor is used only for inside-process notification deliveries.
publish
in interface NotificationPublishService<org.opendaylight.yangtools.yang.binding.Notification>
publish
in interface NotificationProviderService
notification
- the notification to publish.service
- the executor that will be used to deliver notifications to
subscribed listeners.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<?>>
public org.opendaylight.yangtools.concepts.ListenerRegistration<NotificationProviderService.NotificationInterestListener> registerInterestListener(NotificationProviderService.NotificationInterestListener interestListener)
NotificationProviderService
On registration of this listener, the
NotificationProviderService.NotificationInterestListener.onNotificationSubscribtion(Class)
method
will be invoked for every notification type that currently has a notification listener
subscribed.
registerInterestListener
in interface NotificationProviderService
interestListener
- the listener that will be notified when subscriptions
for new notification types occur.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.