CommandEvents (Grails 3.2.6)
Date: 2017-02-09

Package: org.grails.cli.profile.commands.events

## [Groovy] Trait CommandEvents

- org.grails.cli.profile.commands.events.CommandEvents

- Allows for listening and reacting to events triggered by other commands

  Authors:
    Graeme Rocher
  Since:
    3.0

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `after(java.lang.String commandName, groovy.lang.Closure callable)` Register to listen for an event that runs before the given command
    `void` | `before(java.lang.String commandName, groovy.lang.Closure callable)` Register to listen for an event that runs before the given command
    `void` | `notify(java.lang.String eventName, java.lang.Object... args)` Notify of an event
    `void` | `on(java.lang.String eventName, groovy.lang.Closure callable)` Register to listen for an event

- - ### Method Detail

    - #### void after(java.lang.String commandName, @groovy.lang.DelegatesTo(GroovyScriptCommand) groovy.lang.Closure callable)

      Register to listen for an event that runs before the given command

      Parameters:
        `eventName` - The name of the event
        `callable` - The closure that is executed when the event is fired

    - #### void before(java.lang.String commandName, @groovy.lang.DelegatesTo(GroovyScriptCommand) groovy.lang.Closure callable)

      Register to listen for an event that runs before the given command

      Parameters:
        `eventName` - The name of the event
        `callable` - The closure that is executed when the event is fired

    - #### void notify(java.lang.String eventName, java.lang.Object... args)

      Notify of an event

      Parameters:
        `eventName` - The name of the event
        `args` - The arguments to the event

    - #### void on(java.lang.String eventName, @groovy.lang.DelegatesTo(GroovyScriptCommand) groovy.lang.Closure callable)

      Register to listen for an event

      Parameters:
        `eventName` - The name of the event
        `callable` - The closure that is executed when the event is fired