Package org.cometd.javascript
Class JavaScriptThreadModel
java.lang.Object
org.mozilla.javascript.ScriptableObject
org.cometd.javascript.JavaScriptThreadModel
- All Implemented Interfaces:
Serializable
,Runnable
,ThreadModel
,org.mozilla.javascript.ConstProperties
,org.mozilla.javascript.debug.DebuggableObject
,org.mozilla.javascript.Scriptable
public class JavaScriptThreadModel extends org.mozilla.javascript.ScriptableObject implements Runnable, ThreadModel
The thread model object, that runs all javascript in a single thread to simulate browser's environment.
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description JavaScriptThreadModel()
JavaScriptThreadModel(org.mozilla.javascript.ScriptableObject rootScope)
-
Method Summary
Modifier and Type Method Description void
define(Class<? extends org.mozilla.javascript.Scriptable> clazz)
void
destroy()
Object
evaluate(String scriptName, String script)
Object
evaluate(URL url)
Object
get(String name)
String
getClassName()
void
init()
Object
invoke(boolean sync, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thiz, String functionName, Object... arguments)
Object
invoke(boolean sync, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thiz, org.mozilla.javascript.Function function, Object... arguments)
Object
jsFunction_invoke(org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thiz, org.mozilla.javascript.Function function)
void
remove(String name)
void
run()
Methods inherited from class org.mozilla.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, equivalentValues, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasInstance, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size
-
Constructor Details
-
JavaScriptThreadModel
public JavaScriptThreadModel() -
JavaScriptThreadModel
public JavaScriptThreadModel(org.mozilla.javascript.ScriptableObject rootScope)
-
-
Method Details
-
init
- Specified by:
init
in interfaceThreadModel
- Throws:
Exception
-
destroy
- Specified by:
destroy
in interfaceThreadModel
- Throws:
Exception
-
getClassName
- Specified by:
getClassName
in interfaceorg.mozilla.javascript.Scriptable
- Specified by:
getClassName
in classorg.mozilla.javascript.ScriptableObject
-
run
public void run() -
evaluate
- Specified by:
evaluate
in interfaceThreadModel
- Throws:
IOException
-
evaluate
- Specified by:
evaluate
in interfaceThreadModel
-
jsFunction_invoke
public Object jsFunction_invoke(org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thiz, org.mozilla.javascript.Function function) -
invoke
public Object invoke(boolean sync, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thiz, org.mozilla.javascript.Function function, Object... arguments)- Specified by:
invoke
in interfaceThreadModel
-
invoke
public Object invoke(boolean sync, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thiz, String functionName, Object... arguments)- Specified by:
invoke
in interfaceThreadModel
-
define
public void define(Class<? extends org.mozilla.javascript.Scriptable> clazz) throws InvocationTargetException, IllegalAccessException, InstantiationException- Specified by:
define
in interfaceThreadModel
- Throws:
InvocationTargetException
IllegalAccessException
InstantiationException
-
get
- Specified by:
get
in interfaceThreadModel
-
remove
- Specified by:
remove
in interfaceThreadModel
-