(Quick Reference)

11.3.5 Events from Spring

Version: 3.2.6

11.3.5 Events from Spring

Spring also fires a number of useful events. All events in the org.springframework package are prefixed with spring:.

For example:

import org.springframework.web.context.support.*
import org.springframework.boot.context.event.*
...

on("spring:applicationStarted") { ApplicationStartedEvent event ->
        // fired when the application starts
}

on("spring:servletRequestHandled") { RequestHandledEvent event ->
        // fired each time a request is handled
}