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
 
 
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onEvent(String correlationId, IEvent event, Parameters args)
    A method called when events this listener is subscrubed to are fired.
  • Method Details

    • onEvent

      void onEvent(String correlationId, IEvent event, Parameters args)
      A method called when events this listener is subscrubed to are fired.
      Parameters:
      event - a fired event
      correlationId - optional transaction id to trace calls across components.
      args - event arguments.