Package delight.rhinosandox.internal
Class SafeContext
- java.lang.Object
-
- org.mozilla.javascript.ContextFactory
-
- delight.rhinosandox.internal.SafeContext
-
public class SafeContext extends org.mozilla.javascript.ContextFactory
see http://www-archive.mozilla.org/rhino/apidocs/org/mozilla/javascript/ContextFactory.html Also see https://github.com/flozano/rhino-sandbox-test/blob/master/src/main/java/com/flozano/rhino/sandbox/SandboxContextFactory.java
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SafeContext.CountContext
-
Field Summary
Fields Modifier and Type Field Description SafeClassShutter
classShutter
private static int
INSTRUCTION_STEPS
int
maxInstructions
long
maxRuntimeInMs
-
Constructor Summary
Constructors Constructor Description SafeContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
doTopCall(org.mozilla.javascript.Callable callable, org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args)
boolean
hasFeature(org.mozilla.javascript.Context cx, int featureIndex)
org.mozilla.javascript.Context
makeContext()
void
observeInstructionCount(org.mozilla.javascript.Context cx, int instructionCount)
-
Methods inherited from class org.mozilla.javascript.ContextFactory
addListener, call, checkNotSealed, createClassLoader, enter, enterContext, enterContext, exit, getApplicationClassLoader, getE4xImplementationFactory, getGlobal, getGlobalSetter, hasExplicitGlobal, initApplicationClassLoader, initGlobal, isSealed, onContextCreated, onContextReleased, removeListener, seal
-
-
-
-
Field Detail
-
INSTRUCTION_STEPS
private static final int INSTRUCTION_STEPS
- See Also:
- Constant Field Values
-
maxRuntimeInMs
public long maxRuntimeInMs
-
maxInstructions
public int maxInstructions
-
classShutter
public SafeClassShutter classShutter
-
-
Method Detail
-
makeContext
public org.mozilla.javascript.Context makeContext()
- Overrides:
makeContext
in classorg.mozilla.javascript.ContextFactory
-
hasFeature
public boolean hasFeature(org.mozilla.javascript.Context cx, int featureIndex)
- Overrides:
hasFeature
in classorg.mozilla.javascript.ContextFactory
-
observeInstructionCount
public void observeInstructionCount(org.mozilla.javascript.Context cx, int instructionCount)
- Overrides:
observeInstructionCount
in classorg.mozilla.javascript.ContextFactory
-
doTopCall
public java.lang.Object doTopCall(org.mozilla.javascript.Callable callable, org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args)
- Overrides:
doTopCall
in classorg.mozilla.javascript.ContextFactory
-
-