| com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory
HtmlUnitContextFactory | public class HtmlUnitContextFactory extends ContextFactory (Code) | | ContextFactory that supports termination of scripts if they exceed a timeout. Based on example from
ContextFactory.
version: $Revision: 2132 $ author: Andre Soereng |
Method Summary | |
protected Object | doTopCall(Callable callable, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) | public static boolean | getDebuggerEnabled() Returns true if the debugger is enabled, false otherwise. | public static long | getTimeout() Returns the number of milliseconds a script is allowed to execute before
being terminated. | protected boolean | hasFeature(Context cx, int featureIndex) | protected Context | makeContext() | protected void | observeInstructionCount(Context cx, int instructionCount) Run-time calls this when instruction counting is enabled and the counter
reaches limit set by setInstructionObserverThreshold(). | public static void | setDebuggerEnabled(boolean enabled) Enables or disables the debugger, which logs stack entries and exceptions. | public static void | setTimeout(long timeout) Set the number of milliseconds a script is allowed to execute before
being terminated. |
HtmlUnitContextFactory | public HtmlUnitContextFactory(Log log)(Code) | | Create a new instance of HtmlUnitContextFactory
Parameters: log - the log that the error reporter should use |
doTopCall | protected Object doTopCall(Callable callable, Context cx, Scriptable scope, Scriptable thisObj, Object[] args)(Code) | | |
getDebuggerEnabled | public static boolean getDebuggerEnabled()(Code) | | Returns true if the debugger is enabled, false otherwise.
true if the debugger is enabled, false otherwise See Also: DebuggerImpl See Also: DebugFrameImpl |
getTimeout | public static long getTimeout()(Code) | | Returns the number of milliseconds a script is allowed to execute before
being terminated. A value of 0 or less means no timeout.
the timeout value. Default value is 0. |
hasFeature | protected boolean hasFeature(Context cx, int featureIndex)(Code) | | |
makeContext | protected Context makeContext()(Code) | | |
observeInstructionCount | protected void observeInstructionCount(Context cx, int instructionCount)(Code) | | Run-time calls this when instruction counting is enabled and the counter
reaches limit set by setInstructionObserverThreshold(). A script can be
terminated by throwing an Error instance here.
Parameters: cx - the context calling us Parameters: instructionCount - amount of script instruction executed since last call to observeInstructionCount |
setDebuggerEnabled | public static void setDebuggerEnabled(boolean enabled)(Code) | | Enables or disables the debugger, which logs stack entries and exceptions. Enabling the
debugger may be useful if HtmlUnit is having trouble with JavaScript, especially if you are
using some of the more advanced libraries like Dojo, Prototype or jQuery.
Parameters: enabled - whether or not the debugger should be enabled See Also: DebuggerImpl See Also: DebugFrameImpl |
setTimeout | public static void setTimeout(long timeout)(Code) | | Set the number of milliseconds a script is allowed to execute before
being terminated. A value of 0 or less means no timeout.
Parameters: timeout - the timeout value |
|
|