Class JavaScript

java.lang.Object
org.cometd.javascript.JavaScript
All Implemented Interfaces:
Runnable

public class JavaScript extends Object implements Runnable
  • Constructor Details

    • JavaScript

      public JavaScript()
  • Method Details

    • bindings

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

      public void init()
    • destroy

      public void destroy() throws Exception
      Throws:
      Exception
    • 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)
    • put

      public void put(String key, Object value)
    • 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