public class ObservedContextFactory
extends org.mozilla.javascript.ContextFactory
StandardScriptEngineManager. As a singleton, it can
act to indicate to this factory when the server configuration for the scripted auth module
has been altered.
By overriding the observeInstructionCount function, and setting the instructionObserverThreshold
low, the context is able to detect when it has gone over its timelimit. In this case, it will throw
a runtime exception, which will prevent any further execution in this engine.| Modifier and Type | Class and Description |
|---|---|
protected static class |
ObservedContextFactory.ObservedJavaScriptContext
This Context is configured in such a way that we are able to ensure we can determine the
length of time that the script has been running.
|
| Constructor and Description |
|---|
ObservedContextFactory(StandardScriptEngineManager manager) |
| Modifier and Type | Method and Description |
|---|---|
protected org.mozilla.javascript.Context |
makeContext() |
protected void |
observeInstructionCount(org.mozilla.javascript.Context cx,
int instructionCount) |
addListener, call, checkNotSealed, createClassLoader, doTopCall, enter, enterContext, enterContext, exit, getApplicationClassLoader, getE4xImplementationFactory, getGlobal, getGlobalSetter, hasExplicitGlobal, hasFeature, initApplicationClassLoader, initGlobal, isSealed, onContextCreated, onContextReleased, removeListener, sealpublic ObservedContextFactory(StandardScriptEngineManager manager)
protected org.mozilla.javascript.Context makeContext()
makeContext in class org.mozilla.javascript.ContextFactoryprotected void observeInstructionCount(org.mozilla.javascript.Context cx,
int instructionCount)
observeInstructionCount in class org.mozilla.javascript.ContextFactorymakeContext()Copyright © 2010–2024 Open Identity Platform Community. All rights reserved.