public class Notifier extends Object implements INotifier
notifier
.Constructor and Description |
---|
Notifier() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(IListener listener)
Adds a listener to this notifier.
|
void |
fireEvent() |
void |
fireEvent(IEvent event) |
void |
fireEvent(IEvent event,
IListener[] listeners) |
protected void |
fireThrowable(Throwable throwable) |
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.
|
public void addListener(IListener listener)
INotifier
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,
addListener
in interface INotifier
public void removeListener(IListener listener)
INotifier
removeListener
in interface INotifier
public boolean hasListeners()
INotifier
true
if one or more listeners are registered with this notifier, false
otherwise.hasListeners
in interface INotifier
public IListener[] getListeners()
INotifier
Depending on the implementation duplicate listeners may be contained in the returned array.
getListeners
in interface INotifier
public void fireEvent()
public void fireEvent(IEvent event)
protected void fireThrowable(Throwable throwable)
protected ExecutorService getNotificationService()
protected void firstListenerAdded()
protected void lastListenerRemoved()
Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.