...
After parsing the command handlers, the Talon XVM parses the application's event handlers. This is done by using the following method on the application's main class to first fetch the set of application objects that contain the application's event handlers and then parsing those objects for event handlers.
Code Block |
---|
|
@com.neeve.server.app.annotations.AppEventHandlerContainerAccessorAppEventHandlerContainersAccessor
public void addEventHandlerContainerObjects(Set<Object> containers) {...} |
Discover Event Handlers
Event handler methods are those that are annotated with the @com.neeve.aep.annotations.EventHandler annotation. Event handlers are single argument methods that contain an event or a message type as their argument. The Talon XVM and AEP engine dispatch events to the application event handlers. The following are some examples of event handlers.
Code Block |
---|
|
@com.neeve.aep.annotations.EventHandler
public void onEngineActivated(final com.neeve.aep.event.AepEngineActiveEvent event) {...); |
Code Block |
---|
|
@com.neeve.aep.annotations.EventHandler
public void onOrder(final NewOrderMessage message) {..}; |
After collating all the event handler container objects obtained via the previous step, the server then parses the objects for event handlers. The parsed event handlers are used by both the server and the AEP engine to dispatch events to the application.
...