concept event in category grails

This is an excerpt from Manning's book Grails in Action, Second Edition.
One important modification to the original code generated by the Spring Security Core plugin is the removal of the event handlers beforeInsert() and beforeUpdate(). You do this because modifying field values before they’re persisted to the database causes behavior around validation that’s difficult to understand. It’s also confusing from the developer’s perspective because there’s a discrepancy between the initial value set and the one stored.
Well, one of the original intents of the Platform Core plugin was to provide a way for plugins to notify both the application and other plugins that a particular event occurred. Think of a Grails Security plugin. When the plugin logs the user in or out of the application, other services and plugins (such as an Audit plugin) may also want to be notified that the event occurred so the user can log out. The UI may also like to listen in on this event so it can notify any followers of the user that they are online or offline. The Events API provides a perfect way to implement this kind of logic while keeping all the parts of the system loosely coupled.
In this scenario, the login process raises or fires an event, while the other plugins and services declare a listener to observe any events generated by the app. Neither sender nor listener is aware of the other, which makes it extensible for situations that you never imagined when you first raised the event.
Enough theory about event-driven architecture, let’s implement eventing! You’ll implement a basic security audit service, then enhance it to take you through more sophisticated uses of events.
The most common approach for sending off an event is known as fire-and-forget. With this strategy, you generate or raise an event, but you don’t care if anyone is listening, or you aren’t expecting any kind of return value. That’s certainly the case here, so let’s augment your login listener to generate your first event, as shown in the following listing.
The most common format for raising an event is
event topicName, message