Class OSGiNotificationPublishService
- java.lang.Object
-
- org.opendaylight.mdsal.binding.dom.adapter.osgi.OSGiNotificationPublishService
-
- All Implemented Interfaces:
BindingService
,NotificationPublishService
@Beta public final class OSGiNotificationPublishService extends Object implements NotificationPublishService
-
-
Field Summary
-
Fields inherited from interface org.opendaylight.mdsal.binding.api.NotificationPublishService
REJECTED
-
-
Constructor Summary
Constructors Constructor Description OSGiNotificationPublishService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListenableFuture<? extends Object>
offerNotification(Notification notification)
Publishes a notification to subscribed listeners.ListenableFuture<? extends Object>
offerNotification(Notification notification, int timeout, TimeUnit unit)
Publishes a notification to subscribed listeners.void
putNotification(Notification notification)
Publishes a notification to subscribed listeners.
-
-
-
Method Detail
-
putNotification
public void putNotification(Notification notification) throws InterruptedException
Description copied from interface:NotificationPublishService
Publishes a notification to subscribed listeners. This initiates the process of sending the notification, but delivery to the listeners can happen asynchronously, potentially after a call to this method returns. Note: This call will block when the notification queue is full.- Specified by:
putNotification
in interfaceNotificationPublishService
- Parameters:
notification
- the notification to publish.- Throws:
InterruptedException
- if interrupted while waiting
-
offerNotification
public ListenableFuture<? extends Object> offerNotification(Notification notification)
Description copied from interface:NotificationPublishService
Publishes a notification to subscribed listeners. This initiates the process of sending the notification, but delivery to the listeners can happen asynchronously, potentially after a call to this method returns.Still guaranteed not to block. Returns Listenable Future which will complete once.
- Specified by:
offerNotification
in interfaceNotificationPublishService
- Parameters:
notification
- the notification to publish.- Returns:
- A listenable future which will report completion when the service has finished
propagating the notification to its immediate registrants, or
NotificationPublishService.REJECTED
if resource constraints prevent
-
offerNotification
public ListenableFuture<? extends Object> offerNotification(Notification notification, int timeout, TimeUnit unit) throws InterruptedException
Description copied from interface:NotificationPublishService
Publishes a notification to subscribed listeners. This initiates the process of sending the notification, but delivery to the listeners can happen asynchronously, potentially after a call to this method returns. This method is guaranteed not to block more than the specified timeout.- Specified by:
offerNotification
in interfaceNotificationPublishService
- Parameters:
notification
- the notification to publish.timeout
- how long to wait before giving up, in units of unitunit
- a TimeUnit determining how to interpret the timeout parameter- Returns:
- A listenable future which will report completion when the service has finished
propagating the notification to its immediate registrants, or
NotificationPublishService.REJECTED
if resource constraints prevent - Throws:
InterruptedException
- if interrupted while waiting
-
-