rt/vm/src/main/java/org/apidesign/vm4brwsr/Bck2Brwsr.java
branchclosure
changeset 1609 752f48257d4a
parent 1604 7665471a56c1
child 1783 46bf2ce6be79
     1.1 --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/Bck2Brwsr.java	Tue May 27 12:25:41 2014 +0200
     1.2 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/Bck2Brwsr.java	Wed May 28 10:47:18 2014 +0200
     1.3 @@ -26,7 +26,7 @@
     1.4   * be used to bootstrap and load the virtual machine: <pre>
     1.5   * var vm = bck2brwsr();
     1.6   * var main = vm.loadClass('org.your.pkg.Main');
     1.7 - * main.main__V_3Ljava_lang_String_2(null);
     1.8 + * main.invoke('main');
     1.9   * </pre>
    1.10   * In case one wants to initialize the virtual machine with ability to
    1.11   * load classes lazily when needed, one can provide a loader function to
    1.12 @@ -39,15 +39,27 @@
    1.13   * function is asked for its byte code and the system dynamically transforms
    1.14   * it to JavaScript.
    1.15   * <p>
    1.16 - * Instead of a loader function, one can also provide a URL to a JAR file.
    1.17 + * Instead of a loader function, one can also provide a URL to a JAR file
    1.18 + * or a library JavaScript file generated with {@link #library(java.lang.String...)}
    1.19 + * option on.
    1.20   * The <code>bck2brwsr</code> system will do its best to download the file
    1.21 - * and provide loader function for it automatically.
    1.22 + * and provide loader function for it automatically. In order to use
    1.23 + * the JAR file <code>emul.zip</code> module needs to be available in the system.
    1.24   * <p>
    1.25 - * One can provide as many loader functions and JAR URL references as necessary.
    1.26 + * One can provide as many loader functions and URL references as necessary.
    1.27   * Then the initialization code would look like:<pre>
    1.28   * var vm = bck2brwsr(url1, url2, fnctn1, url3, functn2);
    1.29   * </pre>
    1.30   * The provided URLs and loader functions will be consulted one by one.
    1.31 + * <p>
    1.32 + * The initialization of the <b>Bck2Brwsr</b> is done asynchronously since 
    1.33 + * version 0.9. E.g. call to <pre>
    1.34 + * var vm = bck2brwsr('myapp.js');
    1.35 + * var main = vm.loadClass('org.your.pkg.Main');
    1.36 + * main.invoke('main');
    1.37 + * </pre>
    1.38 + * returns immediately and the call to the static main method will happen
    1.39 + * once the virtual machine is initialized and the class available.
    1.40   *
    1.41   * @author Jaroslav Tulach <jtulach@netbeans.org>
    1.42   */