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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(IListener listener) Adds a listener to this notifier.boolean
addUniqueListener
(IListener listener) Adds a listener to this notifier unless this notifier alreadycontains
the listener.void
void
void
protected void
fireThrowable
(Throwable throwable) protected void
Returns the listeners that are registered with this notifier.protected ExecutorService
boolean
hasListener
(IListener listener) Returnstrue
if this notifier contains the listener,false
otherwise.boolean
Returnstrue
if one or more listeners are registered with this notifier,false
otherwise.protected void
protected void
listenerAdded
(IListener listener) protected void
listenerRemoved
(IListener listener) void
removeListener
(IListener listener) Removes a listener from this notifier.
-
Constructor Details
-
Notifier
public Notifier()
-
-
Method Details
-
addUniqueListener
Description copied from interface:INotifier.INotifier2
Adds a listener to this notifier unless this notifier alreadycontains
the listener.- Specified by:
addUniqueListener
in interfaceINotifier.INotifier2
-
addListener
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 interfaceINotifier
-
removeListener
Description copied from interface:INotifier
Removes a listener from this notifier.- Specified by:
removeListener
in interfaceINotifier
-
hasListener
Description copied from interface:INotifier.INotifier2
Returnstrue
if this notifier contains the listener,false
otherwise.- Specified by:
hasListener
in interfaceINotifier.INotifier2
-
hasListeners
public boolean hasListeners()Description copied from interface:INotifier
Returnstrue
if one or more listeners are registered with this notifier,false
otherwise.- Specified by:
hasListeners
in interfaceINotifier
-
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 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
-