Making An Event Listener

To make an event listener, create a Java class that extends one of the following abstract classes:

neo.xredsys.api.EventListenerService

Use this class if you are interested in both local events and remote events .

neo.xredsys.api.LocalEventListenerService

Use this class if you are only interested in local events (remote events are filtered out by this class).

Whichever base class you use, you will need to implement the following methods:

acceptEvent(event)

This method is defined in the neo.xredsys.api.IOEventFilter interface. Use it to determine what event types your listener will respond to. Return true for all events you want your listener to respond to.

handleEvent(event)

This method is defined in the neo.xredsys.api.IOEventListener interface. It will be called every time your acceptEvent() method returns true. Use it to perform whatever action you want to be carried out for accepted events.

Before an event listener can be used it must be:

  • Compiled

  • Added to the Content Engine's classpath

To compile an event listener you need the Escenic JAR file engine-core-5.2.7.2.jar in your classpath.