Package org.htmlunit.javascript
Class PostponedAction
- java.lang.Object
-
- org.htmlunit.javascript.PostponedAction
-
public abstract class PostponedAction extends java.lang.ObjectAn 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 Summary
Fields Modifier and Type Field Description private java.lang.Stringdescription_private java.lang.ref.WeakReference<Page>owningPageRef_
-
Constructor Summary
Constructors Constructor Description PostponedAction(Page owningPage, java.lang.String description)C'tor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidexecute()Execute the action.protected PagegetOwningPage()Gets the owning page.booleanisStillAlive()Indicates if the action still needs to be executed.java.lang.StringtoString()
-
-
-
Field Detail
-
owningPageRef_
private final java.lang.ref.WeakReference<Page> owningPageRef_
-
description_
private final java.lang.String description_
-
-
Constructor Detail
-
PostponedAction
public PostponedAction(Page owningPage, java.lang.String description)
C'tor.- Parameters:
owningPage- the page that initiates this actiondescription- information making debugging easier
-
-
Method Detail
-
getOwningPage
protected Page getOwningPage()
Gets the owning page.- Returns:
- the page that initiated this action or
nullif it has already been GCed
-
execute
public abstract void execute() throws java.lang.ExceptionExecute the action.- Throws:
java.lang.Exception- if it fails
-
isStillAlive
public boolean isStillAlive()
Indicates if the action still needs to be executed.- Returns:
trueif the action needs to be executed
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-