Class JavaScript

    • Constructor Detail

      • JavaScript

        public JavaScript()
    • Method Detail

      • bindings

        public org.graalvm.polyglot.Value bindings()
      • init

        public void init()
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • invoke

        public <T> T invoke​(boolean sync,
                            Object jsThis,
                            Object function,
                            Object... arguments)
      • evaluate

        public <T> T evaluate​(URL url)
      • evaluate

        public <T> T evaluate​(String name,
                              String code)
      • get

        public <T> T get​(String key)
      • schedule

        public ScheduledFuture<?> schedule​(Object jsThis,
                                           Object function,
                                           long delay)
        Invoked from browser.js.
        Parameters:
        jsThis - the JavaScript this reference
        function - the function to invoke after the given delay
        delay - the delay after which the function is invoked, in milliseconds
        Returns:
        a task representing the scheduled execution
      • scheduleWithFixedDelay

        public ScheduledFuture<?> scheduleWithFixedDelay​(Object jsThis,
                                                         Object function,
                                                         long initialDelay,
                                                         long delay)
        Invoked from browser.js.
        Parameters:
        jsThis - the JavaScript this reference
        function - the function to invoke after the given delay
        initialDelay - the delay of the first execution, in milliseconds
        delay - the delay after which the function is invoked, in milliseconds
        Returns:
        a task representing the scheduled execution