Class Notifier

java.lang.Object
org.eclipse.net4j.util.event.Notifier
All Implemented Interfaces:
INotifier, INotifier.INotifier2
Direct Known Subclasses:
AbstractDelegator, ElementWizard, ExecutorServiceNotifier, History, Lifecycle, ValueNotifier

public class Notifier extends Object implements INotifier.INotifier2
A default implementation of a notifier.
Since:
3.0
Author:
Eike Stepper
  • Constructor Details

    • Notifier

      public Notifier()
  • Method Details

    • addUniqueListener

      public boolean addUniqueListener(IListener listener)
      Description copied from interface: INotifier.INotifier2
      Adds a listener to this notifier unless this notifier already contains the listener.
      Specified by:
      addUniqueListener in interface INotifier.INotifier2
    • addListener

      public void addListener(IListener listener)
      Description copied from interface: INotifier
      Adds a listener to this notifier.

      Depending on the implementation duplicate listeners may lead to duplicate event delivery or not. Implementors are encouraged to prevent events from being delivered more than once to the same listener,

      Specified by:
      addListener in interface INotifier
    • removeListener

      public void removeListener(IListener listener)
      Description copied from interface: INotifier
      Removes a listener from this notifier.
      Specified by:
      removeListener in interface INotifier
    • hasListener

      public boolean hasListener(IListener listener)
      Description copied from interface: INotifier.INotifier2
      Returns true if this notifier contains the listener, false otherwise.
      Specified by:
      hasListener in interface INotifier.INotifier2
    • hasListeners

      public boolean hasListeners()
      Description copied from interface: INotifier
      Returns true if one or more listeners are registered with this notifier, false otherwise.
      Specified by:
      hasListeners in interface INotifier
    • getListeners

      public IListener[] getListeners()
      Description copied from interface: INotifier
      Returns the listeners that are registered with this notifier.

      Depending on the implementation duplicate listeners may be contained in the returned array.

      Specified by:
      getListeners in interface INotifier
    • fireEvent

      public void fireEvent()
      Since:
      3.2
    • fireEvent

      public void fireEvent(IEvent event)
    • fireEvent

      public void fireEvent(IEvent event, IListener[] listeners)
      Since:
      3.0
    • fireThrowable

      protected void fireThrowable(Throwable throwable)
      Since:
      3.3
    • getNotificationService

      protected ExecutorService getNotificationService()
      Since:
      3.0
    • listenerAdded

      protected void listenerAdded(IListener listener)
      Since:
      3.13
    • listenerRemoved

      protected void listenerRemoved(IListener listener)
      Since:
      3.13
    • firstListenerAdded

      protected void firstListenerAdded()
      Since:
      3.0
    • lastListenerRemoved

      protected void lastListenerRemoved()
      Since:
      3.0