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 
     

    Nested classes/interfaces inherited from class org.mozilla.javascript.ContextFactory

    org.mozilla.javascript.ContextFactory.GlobalSetter, org.mozilla.javascript.ContextFactory.Listener
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    private static final int
     
    int
     
    long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    doTopCall(org.mozilla.javascript.Callable callable, org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thisObj, Object[] args)
     
    boolean
    hasFeature(org.mozilla.javascript.Context cx, int featureIndex)
     
    org.mozilla.javascript.Context
     
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INSTRUCTION_STEPS

      private static final int INSTRUCTION_STEPS
      See Also:
    • maxRuntimeInMs

      public long maxRuntimeInMs
    • maxInstructions

      public int maxInstructions
    • classShutter

      public SafeClassShutter classShutter
  • Constructor Details

    • SafeContext

      public SafeContext()
  • Method Details

    • makeContext

      public org.mozilla.javascript.Context makeContext()
      Overrides:
      makeContext in class org.mozilla.javascript.ContextFactory
    • hasFeature

      public boolean hasFeature(org.mozilla.javascript.Context cx, int featureIndex)
      Overrides:
      hasFeature in class org.mozilla.javascript.ContextFactory
    • observeInstructionCount

      public void observeInstructionCount(org.mozilla.javascript.Context cx, int instructionCount)
      Overrides:
      observeInstructionCount in class org.mozilla.javascript.ContextFactory
    • doTopCall

      public Object doTopCall(org.mozilla.javascript.Callable callable, org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thisObj, Object[] args)
      Overrides:
      doTopCall in class org.mozilla.javascript.ContextFactory