Class OSGiNotificationPublishService

    • Constructor Detail

      • OSGiNotificationPublishService

        public OSGiNotificationPublishService()
    • 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 interface NotificationPublishService
        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 interface NotificationPublishService
        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 interface NotificationPublishService
        Parameters:
        notification - the notification to publish.
        timeout - how long to wait before giving up, in units of unit
        unit - 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