Class PostponedAction

java.lang.Object
org.htmlunit.javascript.PostponedAction

public abstract class PostponedAction extends Object
An action triggered by a script execution but that should be executed first when the script is finished. Example: when a script sets the source of an (i)frame, the request to the specified page will be first triggered after the script execution.
  • Field Details

    • owningPageRef_

      private final WeakReference<Page> owningPageRef_
    • description_

      private final String description_
  • Constructor Details

    • PostponedAction

      public PostponedAction(Page owningPage, String description)
      C'tor.
      Parameters:
      owningPage - the page that initiates this action
      description - information making debugging easier
  • Method Details

    • getOwningPage

      protected Page getOwningPage()
      Gets the owning page.
      Returns:
      the page that initiated this action or null if it has already been GCed
    • execute

      public abstract void execute() throws Exception
      Execute the action.
      Throws:
      Exception - if it fails
    • isStillAlive

      public boolean isStillAlive()
      Indicates if the action still needs to be executed.
      Returns:
      true if the action needs to be executed
    • toString

      public String toString()
      Overrides:
      toString in class Object