org.cometd
Class JavaScriptThreadModel

java.lang.Object
  extended by org.mozilla.javascript.ScriptableObject
      extended by org.cometd.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.

Version:
$Revision: 1008 $ $Date: 2010-02-28 20:49:47 +0100 (Sun, 28 Feb 2010) $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
JavaScriptThreadModel()
           
JavaScriptThreadModel(org.mozilla.javascript.ScriptableObject rootScope)
           
 
Method Summary
 void define(java.lang.Class clazz)
           
 void destroy()
           
 java.lang.Object evaluate(java.lang.String script)
           
 java.lang.Object evaluate(java.net.URL url)
           
 java.lang.Object execute(org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thiz, org.mozilla.javascript.Function function, java.lang.Object... arguments)
           
 java.lang.Object get(java.lang.String name)
           
 java.lang.String getClassName()
           
 void init()
           
 java.lang.Object jsFunction_execute(org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thiz, org.mozilla.javascript.Function function)
           
 void run()
           
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, get, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaScriptThreadModel

public JavaScriptThreadModel()

JavaScriptThreadModel

public JavaScriptThreadModel(org.mozilla.javascript.ScriptableObject rootScope)
Method Detail

init

public void init()
          throws java.lang.Exception
Specified by:
init in interface ThreadModel
Throws:
java.lang.Exception

destroy

public void destroy()
             throws java.lang.Exception
Specified by:
destroy in interface ThreadModel
Throws:
java.lang.Exception

getClassName

public java.lang.String getClassName()
Specified by:
getClassName in interface org.mozilla.javascript.Scriptable
Specified by:
getClassName in class org.mozilla.javascript.ScriptableObject

run

public void run()
Specified by:
run in interface java.lang.Runnable

evaluate

public java.lang.Object evaluate(java.net.URL url)
                          throws java.io.IOException
Specified by:
evaluate in interface ThreadModel
Throws:
java.io.IOException

evaluate

public java.lang.Object evaluate(java.lang.String script)
Specified by:
evaluate in interface ThreadModel

jsFunction_execute

public java.lang.Object jsFunction_execute(org.mozilla.javascript.Scriptable scope,
                                           org.mozilla.javascript.Scriptable thiz,
                                           org.mozilla.javascript.Function function)

execute

public java.lang.Object execute(org.mozilla.javascript.Scriptable scope,
                                org.mozilla.javascript.Scriptable thiz,
                                org.mozilla.javascript.Function function,
                                java.lang.Object... arguments)
Specified by:
execute in interface ThreadModel

define

public void define(java.lang.Class clazz)
            throws java.lang.reflect.InvocationTargetException,
                   java.lang.IllegalAccessException,
                   java.lang.InstantiationException
Specified by:
define in interface ThreadModel
Throws:
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.InstantiationException

get

public java.lang.Object get(java.lang.String name)
Specified by:
get in interface ThreadModel


Copyright © 2010 Dojo Foundation. All Rights Reserved.