Package org.cometd.javascript
Class JavaScriptThreadModel
- java.lang.Object
-
- org.mozilla.javascript.ScriptableObject
-
- org.cometd.javascript.JavaScriptThreadModel
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Runnable,ThreadModel,org.mozilla.javascript.ConstProperties,org.mozilla.javascript.debug.DebuggableObject,org.mozilla.javascript.Scriptable
public class JavaScriptThreadModel extends org.mozilla.javascript.ScriptableObject implements java.lang.Runnable, ThreadModel
The thread model object, that runs all javascript in a single thread to simulate browser's environment.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JavaScriptThreadModel()JavaScriptThreadModel(org.mozilla.javascript.ScriptableObject rootScope)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefine(java.lang.Class<? extends org.mozilla.javascript.Scriptable> clazz)voiddestroy()java.lang.Objectevaluate(java.lang.String scriptName, java.lang.String script)java.lang.Objectevaluate(java.net.URL url)java.lang.Objectget(java.lang.String name)java.lang.StringgetClassName()voidinit()java.lang.Objectinvoke(boolean sync, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thiz, java.lang.String functionName, java.lang.Object... arguments)java.lang.Objectinvoke(boolean sync, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thiz, org.mozilla.javascript.Function function, java.lang.Object... arguments)java.lang.ObjectjsFunction_invoke(org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thiz, org.mozilla.javascript.Function function)voidremove(java.lang.String name)voidrun()-
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
-
-
-
-
Method Detail
-
init
public void init() throws java.lang.Exception- Specified by:
initin interfaceThreadModel- Throws:
java.lang.Exception
-
destroy
public void destroy() throws java.lang.Exception- Specified by:
destroyin interfaceThreadModel- Throws:
java.lang.Exception
-
getClassName
public java.lang.String getClassName()
- Specified by:
getClassNamein interfaceorg.mozilla.javascript.Scriptable- Specified by:
getClassNamein classorg.mozilla.javascript.ScriptableObject
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
evaluate
public java.lang.Object evaluate(java.net.URL url) throws java.io.IOException- Specified by:
evaluatein interfaceThreadModel- Throws:
java.io.IOException
-
evaluate
public java.lang.Object evaluate(java.lang.String scriptName, java.lang.String script)- Specified by:
evaluatein interfaceThreadModel
-
jsFunction_invoke
public java.lang.Object jsFunction_invoke(org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thiz, org.mozilla.javascript.Function function)
-
invoke
public java.lang.Object invoke(boolean sync, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thiz, org.mozilla.javascript.Function function, java.lang.Object... arguments)- Specified by:
invokein interfaceThreadModel
-
invoke
public java.lang.Object invoke(boolean sync, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thiz, java.lang.String functionName, java.lang.Object... arguments)- Specified by:
invokein interfaceThreadModel
-
define
public void define(java.lang.Class<? extends org.mozilla.javascript.Scriptable> clazz) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.InstantiationException- Specified by:
definein interfaceThreadModel- Throws:
java.lang.reflect.InvocationTargetExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationException
-
get
public java.lang.Object get(java.lang.String name)
- Specified by:
getin interfaceThreadModel
-
remove
public void remove(java.lang.String name)
- Specified by:
removein interfaceThreadModel
-
-