Skip to content
Tyler Treat edited this page Jun 15, 2013 · 2 revisions

The Event annotation indicates the annotated method should be published as a framework event when invoked to be received by EventSubscribers. Events must be enabled in infinitum.cfg.xml and the AOP module must be included:

<application>
    <property name="events">true</property> <!-- [true | false] -->
</application>

If the event name is not provided, the event takes the name of the annotated method. The EventPayload annotation can be used on method parameters to indicate they are part of an event payload.

Event Example

@Event
public void addUser(@EventPayload("user") User user) {
    mUserDao.save(user);
    notifyUser(user);
}

Clone this wiki locally