Interface EventSource

    • Method Detail

      • addListener

        default void addListener​(EventListener listener)
        Adds an EventListener which will be notified whenever the Observable becomes invalid. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.

        Note that the same actual InvalidationListener instance may be safely registered for different UpdateSource.

        The UpdateSource stores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak.

        Parameters:
        listener - The listener to register
        Throws:
        java.lang.NullPointerException - if the listener is null
        See Also:
        removeListener(EventListener)
      • autoNotification

        java.util.concurrent.atomic.AtomicBoolean autoNotification()
        Set the automatic notification of invalidation listeners. In general, data sets should notify registered invalidation listeners, if the data in the data set has changed. Charts usually register an invalidation listener with the data set to be notified of any changes and update the charts. Setting the automatic notification to false, allows applications to prevent this behaviour, in case data sets are updated multiple times during an acquisition cycle but the chart update is only required at the end of the cycle. true for automatic notification
        Returns:
        the atomic boolean
      • invokeListener

        default void invokeListener()
        invoke object within update listener list
      • invokeListener

        default void invokeListener​(UpdateEvent updateEvent)
        invoke object within update listener list
        Parameters:
        updateEvent - the event the listeners are notified with
      • invokeListener

        default void invokeListener​(UpdateEvent updateEvent,
                                    boolean executeParallel)
        invoke object within update listener list
        Parameters:
        updateEvent - the event the listeners are notified with
        executeParallel - true execute event listener via parallel executor service
      • isAutoNotification

        default boolean isAutoNotification()
        Checks it automatic notification is enabled.
        Returns:
        true if automatic notification is enabled
      • removeListener

        default void removeListener​(EventListener listener)
        Removes the given listener from the list of listeners, that are notified whenever the value of the UpdateSource becomes invalid.

        If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.

        Parameters:
        listener - The listener to remove
        Throws:
        java.lang.NullPointerException - if the listener is null
        See Also:
        addListener(EventListener)
      • updateEventListener

        java.util.List<EventListener> updateEventListener()
        Returns:
        list containing all update event listener (needs to be provided by implementing class)