Package org.alfresco.repo.jscript
Class AlfrescoContextFactory
java.lang.Object
org.mozilla.javascript.ContextFactory
org.alfresco.repo.jscript.AlfrescoContextFactory
public class AlfrescoContextFactory
extends org.mozilla.javascript.ContextFactory
Custom factory that allows to apply configured limits during script executions
- See Also:
-
ContextFactory
-
Nested Class Summary
Nested classes/interfaces inherited from class org.mozilla.javascript.ContextFactory
org.mozilla.javascript.ContextFactory.GlobalSetter, org.mozilla.javascript.ContextFactory.Listener -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectdoTopCall(org.mozilla.javascript.Callable callable, org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thisObj, Object[] args) longintintintintprotected org.mozilla.javascript.Contextprotected voidobserveInstructionCount(org.mozilla.javascript.Context cx, int instructionCount) voidsetMaxMemoryUsedInBytes(long maxMemoryUsedInBytes) voidsetMaxScriptExecutionSeconds(int maxScriptExecutionSeconds) voidsetMaxStackDepth(int maxStackDepth) voidsetObserveInstructionCount(int observeInstructionCount) voidsetOptimizationLevel(int optimizationLevel) Methods inherited from class org.mozilla.javascript.ContextFactory
addListener, call, checkNotSealed, createClassLoader, enter, enterContext, enterContext, exit, getApplicationClassLoader, getE4xImplementationFactory, getGlobal, getGlobalSetter, hasExplicitGlobal, hasFeature, initApplicationClassLoader, initGlobal, isSealed, onContextCreated, onContextReleased, removeListener, seal
-
Constructor Details
-
AlfrescoContextFactory
public AlfrescoContextFactory()
-
-
Method Details
-
makeContext
protected org.mozilla.javascript.Context makeContext()- Overrides:
makeContextin classorg.mozilla.javascript.ContextFactory
-
observeInstructionCount
protected void observeInstructionCount(org.mozilla.javascript.Context cx, int instructionCount) - Overrides:
observeInstructionCountin classorg.mozilla.javascript.ContextFactory
-
doTopCall
protected 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:
doTopCallin classorg.mozilla.javascript.ContextFactory
-
getOptimizationLevel
public int getOptimizationLevel() -
setOptimizationLevel
public void setOptimizationLevel(int optimizationLevel) -
getMaxScriptExecutionSeconds
public int getMaxScriptExecutionSeconds() -
setMaxScriptExecutionSeconds
public void setMaxScriptExecutionSeconds(int maxScriptExecutionSeconds) -
getMaxStackDepth
public int getMaxStackDepth() -
setMaxStackDepth
public void setMaxStackDepth(int maxStackDepth) -
getMaxMemoryUsedInBytes
public long getMaxMemoryUsedInBytes() -
setMaxMemoryUsedInBytes
public void setMaxMemoryUsedInBytes(long maxMemoryUsedInBytes) -
getObserveInstructionCount
public int getObserveInstructionCount() -
setObserveInstructionCount
public void setObserveInstructionCount(int observeInstructionCount)
-