com.hammurapi.eventbus
Annotation Type Handler


@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface Handler

Annotation to mark reflective handler methods.


Optional Element Summary
 boolean consumes
           
 EventHandlerBase.Mode mode
          Handler mode.
 boolean oneOff
           
 Class<?>[] posts
          This optional attribute informs the bus about event types which this method posts (if any).
 int priority
           
 String[] value
          Condition definition has the following format [language(parameter list)://] condition expression.
 

priority

public abstract int priority
Returns:
Handler method priority. Methods with higher priority value get invoked before methods with lower priority value. Handler method can invoke consume() method from EventDispatchContext to "consume" source fact(s) and prevent invocation of subsequent handler methods.
Default:
0

value

public abstract String[] value
Condition definition has the following format [language(parameter list)://] condition expression. Default language is Java. If language is not Java, then Extractor framework is used to look up a extractor provider to create extractor from the expression. Parameter list is a comma separated list of parameter names, parameters not used in the condition expression can be omitted. E.g. parent, child, sibling or, if child is not used in the condition expression parent,,sibling. If parameter list is omitted, then arguments can be accessed through args array. Handler method's declaring class instance is available through eCtx parameter.

Default:
{}

posts

public abstract Class<?>[] posts
This optional attribute informs the bus about event types which this method posts (if any). It allows the engine to optimize the predicate network.

Returns:
Default:
{}

consumes

public abstract boolean consumes
Returns:
true if this handler consumes or updates events.
Default:
true

oneOff

public abstract boolean oneOff
Returns:
true if this handler shall be invoked only once.
Default:
false

mode

public abstract EventHandlerBase.Mode mode
Handler mode. Default is POST.

Returns:
Default:
com.hammurapi.eventbus.EventHandlerBase.Mode.POST