public abstract class AbstractListenerProviderRegistry<E extends Event,L extends EventListener<E>,P extends Provider,S extends ProviderService<P>> extends AbstractProviderRegistry<P,S> implements ListenerService<E,L>
Modifier and Type | Field and Description |
---|---|
protected EventDeliveryService |
eventDispatcher |
protected ListenerRegistry<E,L> |
listenerRegistry |
Constructor and Description |
---|
AbstractListenerProviderRegistry() |
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.
|
createProviderService, defaultProvider, getProvider, getProvider, getProvider, getProviders, register, unregister
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