Documenting the Truffle based presenter default tip
authorJaroslav Tulach <jtulach@netbeans.org>
Thu, 21 Jul 2016 11:21:58 +0200
changeset 1105907bcc5dbb00
parent 1104 fbb044757eea
Documenting the Truffle based presenter
boot-truffle/empty.sigtest
boot-truffle/src/main/java/net/java/html/boot/truffle/TrufflePresenters.java
boot-truffle/src/test/java/net/java/html/boot/truffle/TruffleJavaScriptTest.java
pom.xml
src/main/javadoc/overview.html
     1.1 --- a/boot-truffle/empty.sigtest	Thu Jul 21 10:31:09 2016 +0200
     1.2 +++ b/boot-truffle/empty.sigtest	Thu Jul 21 11:21:58 2016 +0200
     1.3 @@ -1,3 +1,21 @@
     1.4  #Signature file v4.1
     1.5  #Version 2.0-SNAPSHOT
     1.6  
     1.7 +CLSS public java.lang.Object
     1.8 +cons public init()
     1.9 +meth protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
    1.10 +meth protected void finalize() throws java.lang.Throwable
    1.11 +meth public boolean equals(java.lang.Object)
    1.12 +meth public final java.lang.Class<?> getClass()
    1.13 +meth public final void notify()
    1.14 +meth public final void notifyAll()
    1.15 +meth public final void wait() throws java.lang.InterruptedException
    1.16 +meth public final void wait(long) throws java.lang.InterruptedException
    1.17 +meth public final void wait(long,int) throws java.lang.InterruptedException
    1.18 +meth public int hashCode()
    1.19 +meth public java.lang.String toString()
    1.20 +
    1.21 +CLSS public final net.java.html.boot.truffle.TrufflePresenters
    1.22 +meth public static org.netbeans.html.boot.spi.Fn$Presenter create(java.util.concurrent.Executor)
    1.23 +supr java.lang.Object
    1.24 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/boot-truffle/src/main/java/net/java/html/boot/truffle/TrufflePresenters.java	Thu Jul 21 11:21:58 2016 +0200
     2.3 @@ -0,0 +1,66 @@
     2.4 +/**
     2.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     2.6 + *
     2.7 + * Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
     2.8 + *
     2.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    2.10 + * Other names may be trademarks of their respective owners.
    2.11 + *
    2.12 + * The contents of this file are subject to the terms of either the GNU
    2.13 + * General Public License Version 2 only ("GPL") or the Common
    2.14 + * Development and Distribution License("CDDL") (collectively, the
    2.15 + * "License"). You may not use this file except in compliance with the
    2.16 + * License. You can obtain a copy of the License at
    2.17 + * http://www.netbeans.org/cddl-gplv2.html
    2.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    2.19 + * specific language governing permissions and limitations under the
    2.20 + * License.  When distributing the software, include this License Header
    2.21 + * Notice in each file and include the License file at
    2.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    2.23 + * particular file as subject to the "Classpath" exception as provided
    2.24 + * by Oracle in the GPL Version 2 section of the License file that
    2.25 + * accompanied this code. If applicable, add the following below the
    2.26 + * License Header, with the fields enclosed by brackets [] replaced by
    2.27 + * your own identifying information:
    2.28 + * "Portions Copyrighted [year] [name of copyright owner]"
    2.29 + *
    2.30 + * Contributor(s):
    2.31 + *
    2.32 + * The Original Software is NetBeans. The Initial Developer of the Original
    2.33 + * Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
    2.34 + *
    2.35 + * If you wish your version of this file to be governed by only the CDDL
    2.36 + * or only the GPL Version 2, indicate your decision by adding
    2.37 + * "[Contributor] elects to include this software in this distribution
    2.38 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
    2.39 + * single choice of license, a recipient has the option to distribute
    2.40 + * your version of this file under either the CDDL, the GPL Version 2 or
    2.41 + * to extend the choice of license to its licensees as provided above.
    2.42 + * However, if you add GPL Version 2 code and therefore, elected the GPL
    2.43 + * Version 2 license, then the option applies only if the new code is
    2.44 + * made subject to such option by the copyright holder.
    2.45 + */
    2.46 +package net.java.html.boot.truffle;
    2.47 +
    2.48 +import java.util.concurrent.Executor;
    2.49 +import org.netbeans.html.boot.spi.Fn;
    2.50 +
    2.51 +
    2.52 +/** Integration with Truffle and
    2.53 + * <a href="http://www.oracle.com/technetwork/oracle-labs/program-languages/overview/">GraalVM</a>.
    2.54 + *
    2.55 + * @since 1.4
    2.56 + */
    2.57 +public final class TrufflePresenters {
    2.58 +    private TrufflePresenters() {
    2.59 +    }
    2.60 +
    2.61 +    /** Creates new instance of Truffle based presenter.
    2.62 +     *
    2.63 +     * @param executor the executor to run requests in
    2.64 +     * @return new instance of the presenter
    2.65 +     */
    2.66 +    public static Fn.Presenter create(Executor executor) {
    2.67 +        return new TrufflePresenter(executor, null);
    2.68 +    }
    2.69 +}
     3.1 --- a/boot-truffle/src/test/java/net/java/html/boot/truffle/TruffleJavaScriptTest.java	Thu Jul 21 10:31:09 2016 +0200
     3.2 +++ b/boot-truffle/src/test/java/net/java/html/boot/truffle/TruffleJavaScriptTest.java	Thu Jul 21 11:21:58 2016 +0200
     3.3 @@ -82,7 +82,7 @@
     3.4          }
     3.5          assertEquals(42, result.as(Number.class).intValue(), "Executed OK");
     3.6  
     3.7 -        final BrowserBuilder bb = BrowserBuilder.newBrowser(new TrufflePresenter(SingleCase.JS, null)).
     3.8 +        final BrowserBuilder bb = BrowserBuilder.newBrowser(TrufflePresenters.create(SingleCase.JS)).
     3.9              loadClass(TruffleJavaScriptTest.class).
    3.10              loadPage("empty.html").
    3.11              invoke("initialized");
     4.1 --- a/pom.xml	Thu Jul 21 10:31:09 2016 +0200
     4.2 +++ b/pom.xml	Thu Jul 21 11:21:58 2016 +0200
     4.3 @@ -146,7 +146,7 @@
     4.4                    </group>
     4.5                    <group>
     4.6                      <title>Testing and Headless API</title>
     4.7 -                    <packages>net.java.html.boot.script</packages>
     4.8 +                    <packages>net.java.html.boot.script:net.java.html.boot.truffle</packages>
     4.9                    </group>
    4.10                    <group>
    4.11                      <title>Service Provider APIs (not commonly interesting)</title>
     5.1 --- a/src/main/javadoc/overview.html	Thu Jul 21 10:31:09 2016 +0200
     5.2 +++ b/src/main/javadoc/overview.html	Thu Jul 21 11:21:58 2016 +0200
     5.3 @@ -81,6 +81,7 @@
     5.4          <a href="net/java/html/js/package-summary.html#undefined">treated as null</a>.
     5.5          Better behavior under <a target="_blank" href="https://netbeans.org/bugzilla/show_bug.cgi?id=259132">
     5.6          multi-threaded load</a>.
     5.7 +        Integration with <a href="net/java/html/boot/truffle/package-summary.html">Truffle</a>.
     5.8  
     5.9          <h3>Improvements in version 1.3</h3>
    5.10