public class HeliumNotificationProviderServiceAdapter extends HeliumNotificationServiceAdapter implements NotificationProviderService
NotificationProviderService.NotificationInterestListener
Constructor and Description |
---|
HeliumNotificationProviderServiceAdapter(NotificationPublishService notificationPublishService,
NotificationService notificationService) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
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 executor)
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.
|
registerNotificationListener, registerNotificationListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
registerNotificationListener, registerNotificationListener
public HeliumNotificationProviderServiceAdapter(NotificationPublishService notificationPublishService, NotificationService notificationService)
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 executor)
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.executor
- the executor that will be used to deliver notifications to
subscribed listeners.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.public void close() throws Exception
close
in interface AutoCloseable
close
in class HeliumNotificationServiceAdapter
Exception
Copyright © 2019 OpenDaylight. All rights reserved.