org.eclipse.net4j.util.event

## Interface INotifier

- All Known Subinterfaces:
    ICacheMonitor, IContainer<E>, IContainer.Modifiable<E>, IContainer.Persistable<E>, IContainerBlockingQueue<E>, IContainerCollection<E>, IContainerList<E>, IContainerMap<K,V>, IContainerQueue<E>, IContainerSet<E>, IContainerSortedSet<E>, IHistory<T>, ILifecycle, IManagedContainer, IOptions, IPluginContainer, IRegistry<K,V>, OMPreferences
  All Known Implementing Classes:
    AbstractDelegator, Cache, CacheMonitor, ChallengeNegotiator, ChallengeResponseNegotiator, Container, ContainerBlockingQueue, ContainerCollection, ContainerList, ContainerMap, ContainerQueue, ContainerSet, ContainerSortedSet, DelegableReentrantLock, DelegatingRegistry, ElementWizard, ExecutorServiceNotifier, ExecutorServiceNotifier.ThreadPool, ExecutorWorkSerializer, FileUserManager, FiniteStateMachine, HashMapDelegatingRegistry, HashMapRegistry, History, Lifecycle, LifecycleHook, ManagedContainer, Negotiator, Notifier, NotifyingMonitor, PreferenceHistory, PriorityQueueRunner, QueueRunner, QueueRunner2, QueueWorker, QueueWorkerWorkSerializer, Randomizer, ReferenceMonitor, ReferenceQueueWorker, Registry, ResponseNegotiator, RollingLog, RWLockManager, RWOLockManager, SashComposite, SerializingExecutor, SetContainer, ShareableLifecycle, TimerLifecycle, UIQueueRunner, UnmodifiableRegistry, UserManager, UserManagerAuthenticator, ValueNotifier, Worker

      public interface INotifier

  An entity that a number of `listeners` can be registered with and that can fire `events` to these registered listeners.

  Implementors are encouraged to document the event types that they are able to fire and that their listeners may want to receive and handle.

  Implementors may want to extend `Notifier` instead of implementing this interface directly.

  Author:
    Eike Stepper

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addListener(IListener listener)` Adds a listener to this notifier.
    `IListener[]` | `getListeners()` Returns the listeners that are registered with this notifier.
    `boolean` | `hasListeners()` Returns `true` if one or more listeners are registered with this notifier, `false` otherwise.
    `void` | `removeListener(IListener listener)` Removes a listener from this notifier.

- - ### Method Detail

    - #### addListener

          void addListener(IListener listener)

      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,

    - #### removeListener

          void removeListener(IListener listener)

      Removes a listener from this notifier.

    - #### hasListeners

          boolean hasListeners()

      Returns `true` if one or more listeners are registered with this notifier, `false` otherwise.
      Since:
        3.0

    - #### getListeners

          IListener[] getListeners()

      Returns the listeners that are registered with this notifier.

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

      Since:
        3.0

Copyright (c) 2004-2019 Eike Stepper (Loehne, 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