CommandEvents (Grails 6.0.0)

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

## [Groovy] Trait CommandEvents

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

-     @groovy.transform.Trait
      @groovy.transform.CompileStatic
      trait CommandEvents
      extends java.lang.Object

  Allows for listening and reacting to events triggered by other commands

  Authors:
    Graeme Rocher
  Since:
    3.0

- - ### Methods Summary

    Methods
    Type Params | Return 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

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Method Detail

    - #### @groovy.transform.Generated void after(java.lang.String commandName, @groovy.lang.DelegatesTo(value: 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

    - #### @groovy.transform.Generated void before(java.lang.String commandName, @groovy.lang.DelegatesTo(value: 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

    - #### @groovy.transform.Generated 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

    - #### @groovy.transform.Generated void on(java.lang.String eventName, @groovy.lang.DelegatesTo(value: 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