@groovy.transform.Trait @java.lang.Deprecated @groovy.transform.CompileStatic trait Events extends java.lang.Object
Bridges the OLD API to the new
Type Params | Return Type | Name and description |
---|---|---|
|
boolean |
clearEventConsumers(java.lang.Object key) Clears event consumers for the given key |
<T> |
Event<T> |
eventFor(T data) Creates an Event for the given data |
<T> |
Event<T> |
eventFor(java.util.Map<java.lang.String, java.lang.Object> headers, T data) Creates an Event for the given headers and data |
<T> |
Event<T> |
eventFor(java.util.Map<java.lang.String, java.lang.Object> headers, T data, groovy.lang.Closure<java.lang.Throwable> errorConsumer) Creates an Event for the given headers, data and error consumer |
|
Bus |
notify(java.lang.Object key, Event<?> ev)
|
|
Bus |
notify(java.lang.Object key, java.lang.Object data)
|
<E extends Event<?>> |
Bus |
notify(java.lang.Object key, groovy.lang.Closure<E> supplier) |
<E extends Event<?>> |
Registration<java.lang.Object, Consumer<E>> |
on(java.lang.Class key, groovy.lang.Closure consumer) |
<E extends Event<?>> |
Registration<java.lang.Object, Consumer<E>> |
on(Selector key, groovy.lang.Closure consumer) |
<E extends Event<?>> |
Registration<java.lang.Object, Consumer<E>> |
on(java.lang.Object key, groovy.lang.Closure consumer) |
<E extends Event<?>> |
Registration<java.lang.Object, Consumer<E>> |
on(java.lang.Object key, Consumer<E> consumer) |
<E extends Event<?>> |
Registration<java.lang.Object, Consumer<E>> |
on(java.lang.Class type, Consumer<E> consumer) |
<E extends Event<?>> |
Registration<java.lang.Object, Consumer<E>> |
on(Selector sel, Consumer<E> consumer) Register a Consumer to be triggered when a notification matches the given Selector. |
|
Bus |
sendAndReceive(java.lang.Object key, java.lang.Object data, groovy.lang.Closure reply) |
<E extends Event<?>> |
Bus |
sendAndReceive(java.lang.Object key, groovy.lang.Closure reply) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), 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() |
Clears event consumers for the given key
key
- The keyCreates an Event for the given data
data
- The dataCreates an Event for the given headers and data
headers
- The headersdata
- The dataCreates an Event for the given headers, data and error consumer
headers
- The headersdata
- The dataerrorConsumer
- The errors consumer
Register a Consumer to be triggered when a notification matches the given Selector.
sel
- The Selector to be used for matchingconsumer
- The Consumer to be triggered
- The type of the Event