| org.openlaszlo.iv.flash.js.Global
Global | public class Global extends ImporterTopLevel (Code) | | This class provides for sharing functions across multiple threads.
This is of particular interest to server applications.
author: Norris Boyd author: Dmitry Skavish |
Method Summary | |
public static void | defineClass(Context cx, Scriptable thisObj, Object[] args, Function funObj) Load a Java class that defines a JavaScript object using the
conventions outlined in ScriptableObject.defineClass. | public static Object | deserialize(Context cx, Scriptable thisObj, Object[] args, Function funObj) | public PrintStream | getErr() | public InputStream | getIn() | public static Global | getInstance(Scriptable scope) | public PrintStream | getOut() | public static Object | getVar(Context cx, Scriptable thisObj, Object[] args, Function funObj) | public static void | load(Context cx, Scriptable thisObj, Object[] args, Function funObj) Load and execute a set of JavaScript source files. | public static void | loadClass(Context cx, Scriptable thisObj, Object[] args, Function funObj) Load and execute a script compiled to a class file.
This method is defined as a JavaScript function.
When called as a JavaScript function, a single argument is
expected. | public static Object | print(Context cx, Scriptable thisObj, Object[] args, Function funObj) Print the string values of its arguments. | public static Object | println(Context cx, Scriptable thisObj, Object[] args, Function funObj) Println the string values of its arguments. | public static void | serialize(Context cx, Scriptable thisObj, Object[] args, Function funObj) | public void | setErr(PrintStream err) | public void | setIn(InputStream in) | public void | setOut(PrintStream out) | public static Object | setVar(Context cx, Scriptable thisObj, Object[] args, Function funObj) | public static Object | spawn(Context cx, Scriptable thisObj, Object[] args, Function funObj) The spawn function runs a given function or script in a different
thread. | public static Object | sync(Context cx, Scriptable thisObj, Object[] args, Function funObj) The sync function creates a synchronized function (in the sense
of a Java synchronized method) from an existing function. | public static double | version(Context cx, Scriptable thisObj, Object[] args, Function funObj) Get and set the language version. |
history | NativeArray history(Code) | | |
Global | public Global(Context cx)(Code) | | |
defineClass | public static void defineClass(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws IllegalAccessException, InstantiationException, InvocationTargetException, ClassDefinitionException, PropertyException(Code) | | Load a Java class that defines a JavaScript object using the
conventions outlined in ScriptableObject.defineClass.
This method is defined as a JavaScript function.
exception: IllegalAccessException - if access is not availableto a reflected class member exception: InstantiationException - if unable to instantiatethe named class exception: InvocationTargetException - if an exception is thrownduring execution of methods of the named class exception: ClassDefinitionException - if the format of theclass causes this exception in ScriptableObject.defineClass exception: PropertyException - if the format of theclass causes this exception in ScriptableObject.defineClass See Also: org.mozilla.javascript.ScriptableObject.defineClass |
getInstance | public static Global getInstance(Scriptable scope)(Code) | | |
getVar | public static Object getVar(Context cx, Scriptable thisObj, Object[] args, Function funObj)(Code) | | Returns variable from associated generator context
|
load | public static void load(Context cx, Scriptable thisObj, Object[] args, Function funObj)(Code) | | Load and execute a set of JavaScript source files.
This method is defined as a JavaScript function.
|
loadClass | public static void loadClass(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws IllegalAccessException, InstantiationException, InvocationTargetException, JavaScriptException(Code) | | Load and execute a script compiled to a class file.
This method is defined as a JavaScript function.
When called as a JavaScript function, a single argument is
expected. This argument should be the name of a class that
implements the Script interface, as will any script
compiled by jsc.
exception: IllegalAccessException - if access is not availableto the class exception: InstantiationException - if unable to instantiatethe named class exception: InvocationTargetException - if an exception is thrownduring execution of methods of the named class exception: JavaScriptException - if a JavaScript exception is thrownduring execution of the compiled script See Also: org.mozilla.javascript.ScriptableObject.defineClass |
print | public static Object print(Context cx, Scriptable thisObj, Object[] args, Function funObj)(Code) | | Print the string values of its arguments.
This method is defined as a JavaScript function.
Note that its arguments are of the "varargs" form, which
allows it to handle an arbitrary number of arguments
supplied to the JavaScript function.
|
println | public static Object println(Context cx, Scriptable thisObj, Object[] args, Function funObj)(Code) | | Println the string values of its arguments.
This method is defined as a JavaScript function.
Note that its arguments are of the "varargs" form, which
allows it to handle an arbitrary number of arguments
supplied to the JavaScript function.
|
serialize | public static void serialize(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws IOException(Code) | | |
setVar | public static Object setVar(Context cx, Scriptable thisObj, Object[] args, Function funObj)(Code) | | Sets variable to associated standard generator context
|
spawn | public static Object spawn(Context cx, Scriptable thisObj, Object[] args, Function funObj)(Code) | | The spawn function runs a given function or script in a different
thread.
js> function g() { a = 7; }
js> a = 3;
3
js> spawn(g)
Thread[Thread-1,5,main]
js> a
3
|
sync | public static Object sync(Context cx, Scriptable thisObj, Object[] args, Function funObj)(Code) | | The sync function creates a synchronized function (in the sense
of a Java synchronized method) from an existing function. The
new function synchronizes on the this object of
its invocation.
js> var o = { f : sync(function(x) {
print("entry");
Packages.java.lang.Thread.sleep(x*1000);
print("exit");
})};
js> spawn(function() {o.f(5);});
Thread[Thread-0,5,main]
entry
js> spawn(function() {o.f(5);});
Thread[Thread-1,5,main]
js>
exit
entry
exit
|
version | public static double version(Context cx, Scriptable thisObj, Object[] args, Function funObj)(Code) | | Get and set the language version.
This method is defined as a JavaScript function.
|
|
|