Event handling
Use of @EventHandler annotation to push data into a SEP
Last updated
Was this helpful?
Use of @EventHandler annotation to push data into a SEP
Last updated
Was this helpful?
The goal is to invoke a method on a user created node when an is posted to the encapsulating SEP.
The method must accept a single argument that is of type and be marked with annotation. There are no requirements on method naming, only the method signature and annotation are analysed by Fluxtion.
Fluxtion employs pattern type matching analysis to ensure the correct method dispatch occurs.
The example is located . A single event type MyEvent will be dispateched to an event handler method, MyEventProcessor.handleEvent
In this example handlesThe method is marked with the annotation to identify it as an event handler method to the Fluxtion compiler at generation time.
Fluxtion ESC will generate the following SEP. The interface method onEvent discovers the runtime type (line 11) and dipatches the event to a type specific handleEvent method (line 20). The execution path is invoked in the handleEvent method.
The SEPConfig class that constructs the graph imperatively is shown below. Use of SEPConfig is described in .