@Retention(value=CLASS)
@Target(value=METHOD)
public @interface OnEvent
Mark a method to be an adhoc event handler for a certain event type The event type is inferred from the method signature
Modifier and Type | Optional Element and Description |
---|---|
boolean |
async
Indicate if the handler should be run synchronously with application
or asynchronously.
|
boolean |
beforeAppStart
When specified as
true then this is to handle event that triggered before application get started and it shall get hooked immediately after classes has been loaded |
public abstract boolean async
Indicate if the handler should be run synchronously with application or asynchronously.
Running job synchronously means the application will not start servicing incoming requests until the job is finished.
Running job asynchronously means the job will start in a separate thread and will not block the app from servicing incoming requests
true
if the annotated method shall be executed asynchronously or false
if the method all be executed synchronouslypublic abstract boolean beforeAppStart
When specified as true
then this is to handle event that triggered before application get started and it shall get hooked immediately after classes has been loaded
true
if the event handler needs to be registered early before app startedCopyright © 2014–2017 ActFramework. All rights reserved.