Improving Javadoc for wait4js attribute async
authorJaroslav Tulach <jaroslav.tulach@netbeans.org>
Sun, 09 Mar 2014 21:13:33 +0100
branchasync
changeset 59217450760bf14
parent 591 25b9c424f7e8
child 593 45e01459f94d
Improving Javadoc for wait4js attribute
boot/src/main/java/net/java/html/js/JavaScriptBody.java
     1.1 --- a/boot/src/main/java/net/java/html/js/JavaScriptBody.java	Sun Mar 09 20:20:01 2014 +0100
     1.2 +++ b/boot/src/main/java/net/java/html/js/JavaScriptBody.java	Sun Mar 09 21:13:33 2014 +0100
     1.3 @@ -93,6 +93,31 @@
     1.4       *   syntax
     1.5       */
     1.6      public boolean javacall() default false;
     1.7 -    
     1.8 +
     1.9 +    /** Should we wait before the JavaScript snippet execution finishes?
    1.10 +     * Or not. 
    1.11 +     * <p>
    1.12 +     * Some implementations that recognize the {@link JavaScriptBody} annotation
    1.13 +     * need to reschedule the JavaScript execution into different thread and
    1.14 +     * then it is easier for them to perform the execution asynchronously
    1.15 +     * and not wait for the result of the execution. This may however be
    1.16 +     * unexpected (for example when one awaits a callback into Java)
    1.17 +     * and as such it has to be explicitly allowed by specifying
    1.18 +     * <code>wait4js = false</code>. Such methods need to return <code>void</code>.
    1.19 +     * <p>
    1.20 +     * Implementations that execute the JavaScript synchronously may ignore
    1.21 +     * this attribute.
    1.22 +     * <p>
    1.23 +     * Implementations that delay execution of JavaScript need to guarantee
    1.24 +     * the order of snippets. Those that were submitted sooner, need to be
    1.25 +     * executed sooner. Each snippet need to be executed in a timely manner
    1.26 +     * (e.g. by a second, or so) even if there are no other calls made
    1.27 +     * in the main program.
    1.28 +     * <p>
    1.29 +     * 
    1.30 +     * @since 0.7.6
    1.31 +     * @return <code>false</code> in case one allows asynchronous execution
    1.32 +     *   of the JavaScript snippet
    1.33 +     */
    1.34      public boolean wait4js() default true;
    1.35  }