Package org.eclipse.net4j.util.event
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 java.lang.Object implements INotifier.INotifier2
A default implementation of anotifier.- Since:
- 3.0
- Author:
- Eike Stepper
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
INotifier.INotifier2
-
-
Constructor Summary
Constructors Constructor Description Notifier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(IListener listener)Adds a listener to this notifier.booleanaddUniqueListener(IListener listener)Adds a listener to this notifier unless this notifier alreadycontainsthe listener.voidfireEvent()voidfireEvent(IEvent event)voidfireEvent(IEvent event, IListener[] listeners)protected voidfireThrowable(java.lang.Throwable throwable)protected voidfirstListenerAdded()IListener[]getListeners()Returns the listeners that are registered with this notifier.protected java.util.concurrent.ExecutorServicegetNotificationService()booleanhasListener(IListener listener)Returnstrueif this notifier contains the listener,falseotherwise.booleanhasListeners()Returnstrueif one or more listeners are registered with this notifier,falseotherwise.protected voidlastListenerRemoved()protected voidlistenerAdded(IListener listener)protected voidlistenerRemoved(IListener listener)voidremoveListener(IListener listener)Removes a listener from this notifier.
-
-
-
Method Detail
-
addUniqueListener
public boolean addUniqueListener(IListener listener)
Description copied from interface:INotifier.INotifier2Adds a listener to this notifier unless this notifier alreadycontainsthe listener.- Specified by:
addUniqueListenerin interfaceINotifier.INotifier2
-
addListener
public void addListener(IListener listener)
Description copied from interface:INotifierAdds 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:
addListenerin interfaceINotifier
-
removeListener
public void removeListener(IListener listener)
Description copied from interface:INotifierRemoves a listener from this notifier.- Specified by:
removeListenerin interfaceINotifier
-
hasListener
public boolean hasListener(IListener listener)
Description copied from interface:INotifier.INotifier2Returnstrueif this notifier contains the listener,falseotherwise.- Specified by:
hasListenerin interfaceINotifier.INotifier2
-
hasListeners
public boolean hasListeners()
Description copied from interface:INotifierReturnstrueif one or more listeners are registered with this notifier,falseotherwise.- Specified by:
hasListenersin interfaceINotifier
-
getListeners
public IListener[] getListeners()
Description copied from interface:INotifierReturns the listeners that are registered with this notifier.Depending on the implementation duplicate listeners may be contained in the returned array.
- Specified by:
getListenersin interfaceINotifier
-
fireEvent
public void fireEvent()
- Since:
- 3.2
-
fireEvent
public void fireEvent(IEvent event)
-
fireThrowable
protected void fireThrowable(java.lang.Throwable throwable)
- Since:
- 3.3
-
getNotificationService
protected java.util.concurrent.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
-
-