Package io.atomix.utils.event
Class AbstractListenerManager<E extends Event,L extends EventListener<E>>
- java.lang.Object
-
- io.atomix.utils.event.AbstractListenerManager<E,L>
-
- All Implemented Interfaces:
ListenerService<E,L>
public abstract class AbstractListenerManager<E extends Event,L extends EventListener<E>> extends Object implements ListenerService<E,L>
Basis for components which need to export listener mechanism.
-
-
Field Summary
Fields Modifier and Type Field Description protected ListenerRegistry<E,L>listenerRegistry
-
Constructor Summary
Constructors Constructor Description AbstractListenerManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(L listener)Adds the specified listener.protected voidpost(E event)Posts the specified event to the local event dispatcher.voidremoveListener(L listener)Removes the specified listener.
-
-
-
Field Detail
-
listenerRegistry
protected final ListenerRegistry<E extends Event,L extends EventListener<E>> listenerRegistry
-
-
Method Detail
-
addListener
public void addListener(L listener)
Description copied from interface:ListenerServiceAdds the specified listener.- Specified by:
addListenerin interfaceListenerService<E extends Event,L extends EventListener<E>>- Parameters:
listener- listener to be added
-
removeListener
public void removeListener(L listener)
Description copied from interface:ListenerServiceRemoves the specified listener.- Specified by:
removeListenerin interfaceListenerService<E extends Event,L extends EventListener<E>>- Parameters:
listener- listener to be removed
-
post
protected void post(E event)
Posts the specified event to the local event dispatcher.- Parameters:
event- event to be posted; may be null
-
-