org.eclipse.net4j.util.event
Interface INotifier

All Known Subinterfaces:
ICacheMonitor, IContainer<E>, IContainer.Modifiable<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, DelegatingRegistry, ElementWizard, ExecutorServiceNotifier, ExecutorServiceNotifier.ThreadPool, FileUserManager, FiniteStateMachine, HashMapDelegatingRegistry, HashMapRegistry, History, Lifecycle, ManagedContainer, Negotiator, Notifier, NotifyingMonitor, PreferenceHistory, QueueRunner, QueueWorker, QueueWorkerWorkSerializer, Randomizer, ReferenceQueueWorker, Registry, ResponseNegotiator, RWLockManager, RWOLockManager, SashComposite, TimerLifecycle, UIQueueRunner, UnmodifiableRegistry, UserManager, 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
 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 - 2011 Eike Stepper (Berlin, Germany) and others.