Interface NotificationListener

    • Method Detail

      • onNotification

        void onNotification​(NotificationEvent event)
                     throws java.lang.Exception
        Receive a Notification that a product is available. If this NotificationListener is interested in the Product, it may use the convenience method getProduct():
         Product product = event.getProduct();
         
        When getTimeout() returns a positive (>0) number of milliseconds, the thread calling onNotification may be interrupted. Listeners should use care in handling InterruptedExceptions to ensure resources are properly freed.
        Parameters:
        event - the event corresponding to the notification that is available.
        Throws:
        ContinuableListenerException - if redelivery should be attempted (depending on what getAttemptCount() returns).
        java.lang.Exception
        See Also:
        ContinuableListenerException, InterruptedException, getMaxTries()
      • getMaxTries

        int getMaxTries()
        A NotificationReceiver that generates a NotificationEvent will attempt to deliver the event up to this many times, if the listener throws an Exception while processing.
        Returns:
        A value of 1 or less means do not attempt more than once.
      • getTimeout

        long getTimeout()
        A NotificationListener has this many milliseconds to process a notification before being interrupted.
        Returns:
        number of milliseconds before timing out. A value of 0 or less means never time out.