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
A default implementation of a
notifier.- 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(IListener listener) Adds a listener to this notifier.booleanaddUniqueListener(IListener listener) Adds a listener to this notifier unless this notifier alreadycontainsthe listener.voidvoidvoidprotected voidfireThrowable(Throwable throwable) protected voidReturns the listeners that are registered with this notifier.protected ExecutorServicebooleanhasListener(IListener listener) Returnstrueif this notifier contains the listener,falseotherwise.booleanReturnstrueif one or more listeners are registered with this notifier,falseotherwise.protected voidprotected voidlistenerAdded(IListener listener) protected voidlistenerRemoved(IListener listener) voidremoveListener(IListener listener) Removes a listener from this notifier.
-
Constructor Details
-
Notifier
public Notifier()
-
-
Method Details
-
addUniqueListener
Description copied from interface:INotifier.INotifier2Adds a listener to this notifier unless this notifier alreadycontainsthe listener.- Specified by:
addUniqueListenerin interfaceINotifier.INotifier2
-
addListener
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
Description copied from interface:INotifierRemoves a listener from this notifier.- Specified by:
removeListenerin interfaceINotifier
-
hasListener
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
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
-
fireEvent
- Since:
- 3.0
-
fireThrowable
- Since:
- 3.3
-
getNotificationService
- Since:
- 3.0
-
listenerAdded
- Since:
- 3.13
-
listenerRemoved
- Since:
- 3.13
-
firstListenerAdded
protected void firstListenerAdded()- Since:
- 3.0
-
lastListenerRemoved
protected void lastListenerRemoved()- Since:
- 3.0
-