@Target(value=METHOD)
@Retention(value=RUNTIME)
public static @interface Events.Subscribe
Method marked with this annotation will receive events with specified key on main thread.
See Events.Background
annotation if you want to receive events on background thread.
See Events.Cache
annotation if you want to use cache feature.
You may listen for event's execution status using methods annotated with Events.Status
.
Object returned from this method will be sent to the bus and can be received by anyone
using methods annotated with Events.Result
.
You can return EventResult
object which can contain several values.
You can also send several results during method execution using
Event.postResult(EventResult)
and Event.postResult(Object...)
.
Any uncaught exception thrown during method execution will be sent to the bus and can be
received using methods annotated with Events.Failure
.
Allowed method parameters
WhereT1, T2, ...
- corresponding types of values passed to
Event.Builder.param(Object...)
method. You may also access event's parameters
using Event.getParam(int)
method.Modifier and Type | Required Element and Description |
---|---|
java.lang.String |
value |