Annotation Type Async


  • @Documented
    @Target(METHOD)
    @Retention(RUNTIME)
    public @interface Async
    Marks a method for asynchronous execution.

    Add this annotation to the method you want to execute asynchronously. Methods of return type void and Future are supported. In the latter case, an actual asynchronous Future will be returned, but the target method should return a temporary Future that passes the value through as the return type needs to be the same.

    Usage with other return types may cause unexpected behavior (because NULL will always be returned).

    Keep in mind that there is a limited number of threads working with methods annotated with @Async. Thus, if one of your methods keep a thread busy for a long time, others will wait. Try to make all methods fast, when you annotate them with @Async.

    Since:
    0.16
    See Also:
    http://aspects.jcabi.com/