org.eclipse.net4j.util.event
Class Notifier

java.lang.Object
  extended by 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

Since:
3.0
Author:
Eike Stepper

Constructor Summary
Notifier()
           
 
Method Summary
 void addListener(IListener listener)
          Adds a listener to this notifier.
 void fireEvent()
           
 void fireEvent(IEvent event)
           
 void fireEvent(IEvent event, IListener[] listeners)
           
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

getNotificationService

protected ExecutorService getNotificationService()
Since:
3.0

firstListenerAdded

protected void firstListenerAdded()
Since:
3.0

lastListenerRemoved

protected void lastListenerRemoved()
Since:
3.0


Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.