org.eclipse.net4j.util.event

## Class Notifier

- java.lang.Object
- - org.eclipse.net4j.util.event.Notifier

- All Implemented Interfaces:
    INotifier
  Direct Known Subclasses:
    AbstractDelegator, ElementWizard, ExecutorServiceNotifier, History, Lifecycle, ValueNotifier

      public class Notifier
      extends Object
      implements INotifier

  A default implementation of a `notifier`.
  Since:
    3.0
  Author:
    Eike Stepper

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Notifier()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addListener(IListener listener)` Adds a listener to this notifier.
    `void` | `fireEvent()`
    `void` | `fireEvent(IEvent event)`
    `void` | `fireEvent(IEvent event, IListener[] listeners)`
    `protected void` | `fireThrowable(Throwable throwable)`
    `protected void` | `firstListenerAdded()`
    `IListener[]` | `getListeners()` Returns the listeners that are registered with this notifier.
    `protected ExecutorService` | `getNotificationService()`
    `boolean` | `hasListeners()` Returns `true` if one or more listeners are registered with this notifier, `false` otherwise.
    `protected void` | `lastListenerRemoved()`
    `void` | `removeListener(IListener listener)` Removes a listener from this notifier.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Notifier

          public Notifier()

  - ### Method Detail

    - #### 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`

    - #### 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

    - #### firstListenerAdded

          protected void firstListenerAdded()

      Since:
        3.0

    - #### lastListenerRemoved

          protected void lastListenerRemoved()

      Since:
        3.0

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html