public class ListenerRegistry<E extends Event,L extends EventListener<E>> extends Object implements ListenerService<E,L>, EventSink<E>
| Modifier and Type | Field and Description |
|---|---|
protected Set<L> |
listeners
Set of listeners that have registered.
|
| Constructor and Description |
|---|
ListenerRegistry() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(L listener)
Adds the specified listener.
|
void |
onProcessLimit()
Handles notification that event processing time limit has been exceeded.
|
void |
process(E event)
Processes the specified event.
|
void |
removeListener(L listener)
Removes the specified listener.
|
protected void |
reportProblem(E event,
Throwable error)
Reports a problem encountered while processing an event.
|
protected final Set<L extends EventListener<E>> listeners
public void addListener(L listener)
ListenerServiceaddListener in interface ListenerService<E extends Event,L extends EventListener<E>>listener - listener to be addedpublic void removeListener(L listener)
ListenerServiceremoveListener in interface ListenerService<E extends Event,L extends EventListener<E>>listener - listener to be removedpublic void process(E event)
EventSinkpublic void onProcessLimit()
EventSinkonProcessLimit in interface EventSink<E extends Event>