public class Synchronizer extends Delegator
Synchronizer constructor, e.g.
new Packages.org.mozilla.javascript.Synchronizer(fun).
The resulting object is a function that establishes an exclusive
lock on the this object of its invocation.
The Rhino shell provides a short-cut for the creation of
synchronized methods: sync(fun) has the same effect as
calling the above constructor.DelegatorNOT_FOUND| Constructor and Description |
|---|
Synchronizer(Scriptable obj)
Create a new synchronized function from an existing one.
|
Synchronizer(Scriptable obj,
java.lang.Object syncObject)
Create a new synchronized function from an existing one using
an explicit object as synchronization object.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
call(Context cx,
Scriptable scope,
Scriptable thisObj,
java.lang.Object[] args)
Call the function.
|
construct, delete, delete, delete, get, get, get, getClassName, getDefaultValue, getDelegee, getIds, getParentScope, getPrototype, has, has, has, hasInstance, newInstance, put, put, put, setDelegee, setParentScope, setPrototypepublic Synchronizer(Scriptable obj)
obj - the existing functionpublic Synchronizer(Scriptable obj, java.lang.Object syncObject)
obj - the existing functionsyncObject - the object to synchronized onpublic java.lang.Object call(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
FunctionNote that the array of arguments is not guaranteed to have length greater than 0.
call in interface Callablecall in interface Functioncall in class Delegatorcx - the current Context for this threadscope - the scope to execute the function relative to. This is set to the value returned
by getParentScope() except when the function is called from a closure.thisObj - the JavaScript this objectargs - the array of argumentsFunction.call(org.mozilla.javascript.Context, org.mozilla.javascript.Scriptable, org.mozilla.javascript.Scriptable, java.lang.Object[])