@groovy.transform.Trait @groovy.transform.CompileStatic trait CommandEvents extends java.lang.Object
Allows for listening and reacting to events triggered by other commands
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 |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), 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() |
Register to listen for an event that runs before the given command
eventName
- The name of the eventcallable
- The closure that is executed when the event is firedRegister to listen for an event that runs before the given command
eventName
- The name of the eventcallable
- The closure that is executed when the event is firedNotify of an event
eventName
- The name of the eventargs
- The arguments to the eventRegister to listen for an event
eventName
- The name of the eventcallable
- The closure that is executed when the event is fired