public abstract class AbstractListenerManager<E extends Event,L extends EventListener<E>> extends java.lang.Object implements ListenerService<E,L>
Modifier and Type | Field and Description |
---|---|
protected EventDeliveryService |
eventDispatcher |
protected ListenerRegistry<E,L> |
listenerRegistry |
Constructor and Description |
---|
AbstractListenerManager() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(L listener)
Adds the specified listener.
|
protected void |
post(E event)
Safely posts the specified event to the local event dispatcher.
|
void |
removeListener(L listener)
Removes the specified listener.
|
protected final ListenerRegistry<E extends Event,L extends EventListener<E>> listenerRegistry
@Reference(cardinality=MANDATORY_UNARY) protected EventDeliveryService eventDispatcher
public void addListener(L listener)
ListenerService
addListener
in interface ListenerService<E extends Event,L extends EventListener<E>>
listener
- listener to be addedpublic void removeListener(L listener)
ListenerService
removeListener
in interface ListenerService<E extends Event,L extends EventListener<E>>
listener
- listener to be removedprotected void post(E event)
event
- event to be posted; may be null