Package io.meeds.deeds.listener
Interface EventListener<T>
-
- Type Parameters:
T- Event Data Class Type
public interface EventListener<T>An API Interface that can be used to implement a listener that will be triggered once an event is published usingListenerService. In order to inject a new Listener instace, you could implement this interface and add your listener as a SpringComponent. TheListenerService, at startup time, will iterate over all beans implementing this UI to inject it automatically as a listener. else, if you prefer add it manually, you can simply useListenerService.addListener(EventListener).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description StringgetName()List<String>getSupportedEvents()default voidhandleEvent(String eventName, Object data)Deprecated.used for internal casting and must not be overriddenvoidonEvent(String eventName, T data)Handle a published event
-
-
-
Method Detail
-
getName
String getName()
- Returns:
- Unique name of a listener that will be needed to be able to identify the listener in the list of listeners to be able to remove it
-
getSupportedEvents
List<String> getSupportedEvents()
- Returns:
Listof supported events that will be used to trigger the listener if one of thos events had been published
-
handleEvent
@Deprecated(forRemoval=false) default void handleEvent(String eventName, Object data)
Deprecated.used for internal casting and must not be overriddenHandle a published event, must not be overriden, use onEvent instead- Parameters:
eventName- Event namedata- Event data published at the same time by event producer
-
-