Class JavaScriptExecutionJob

java.lang.Object
org.htmlunit.javascript.background.BasicJavaScriptJob
org.htmlunit.javascript.background.JavaScriptExecutionJob
All Implemented Interfaces:
Comparable<JavaScriptJob>, Runnable, JavaScriptJob
Direct Known Subclasses:
JavaScriptFunctionJob, JavaScriptStringJob

abstract class JavaScriptExecutionJob extends BasicJavaScriptJob
A JavaScript-triggered background job representing the execution of some JavaScript code.
  • Field Details

    • LOG

      private static final org.apache.commons.logging.Log LOG
      Logging support.
    • label_

      private final String label_
      The label for this job.
    • window_

      private final WeakReference<WebWindow> window_
      The window to which this job belongs (weakly referenced, so as not to leak memory).
  • Constructor Details

    • JavaScriptExecutionJob

      JavaScriptExecutionJob(int initialDelay, Integer period, String label, WebWindow window)
      Creates a new JavaScript execution job, where the JavaScript code to execute is a string.
      Parameters:
      initialDelay - the initial amount of time to wait before executing this job
      period - the amount of time to wait between executions of this job (may be null)
      label - the label for the job
      window - the window to which the job belongs
  • Method Details

    • run

      public void run()
    • toString

      public String toString()
      Overrides:
      toString in class BasicJavaScriptJob
    • runJavaScript

      protected abstract void runJavaScript(HtmlPage page)
      Run the JavaScript from the concrete class.
      Parameters:
      page - the HtmlPage that owns the script