Class 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  
      • Nested classes/interfaces inherited from class org.mozilla.javascript.ContextFactory

        org.mozilla.javascript.ContextFactory.GlobalSetter, org.mozilla.javascript.ContextFactory.Listener
    • 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
      • Methods inherited from class java.lang.Object

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

      • maxRuntimeInMs

        public long maxRuntimeInMs
      • maxInstructions

        public int maxInstructions
    • Constructor Detail

      • SafeContext

        public SafeContext()
    • Method Detail

      • 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 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 class org.mozilla.javascript.ContextFactory