-
Notifications
You must be signed in to change notification settings - Fork 1
Event
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
public void addUser(@EventPayload("user") User user) {
mUserDao.save(user);
notifyUser(user);
}