Interface IEventListener
public interface IEventListener
An interface for listener objects that receive notifications on fired events.
### Example ###
public class MyListener implements IEventListener {
private void onEvent(String correlationId, IEvent event,Parameters args) {
System.out.println("Fired event " + event.getName());
}
}
Event event = new Event("myevent");
event.addListener(new MyListener());
event.notify("123", Parameters.fromTuples("param1", "ABC"));
// Console output: Fired event myevent
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onEvent
(String correlationId, IEvent event, Parameters args) A method called when events this listener is subscrubed to are fired.
-
Method Details
-
onEvent
A method called when events this listener is subscrubed to are fired.- Parameters:
event
- a fired eventcorrelationId
- optional transaction id to trace calls across components.args
- event arguments.
-