|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mozilla.javascript.Delegator | +--org.mozilla.javascript.Synchronizer
This class provides support for implementing Java-style synchronized
methods in Javascript.
Synchronized functions are created from ordinary Javascript
functions by the 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.
Delegator
Field Summary |
---|
Fields inherited from interface org.mozilla.javascript.Scriptable |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
Synchronizer(org.mozilla.javascript.Scriptable obj)
Create a new synchronized function from an existing one. |
Method Summary | |
---|---|
java.lang.Object |
call(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable scope,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] args)
Call the function. |
Methods inherited from class org.mozilla.javascript.Delegator |
---|
construct, delete, delete, get, get, getClassName, getDefaultValue, getDelegee, getIds, getParentScope, getPrototype, has, has, hasInstance, put, put, setDelegee, setParentScope, setPrototype |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Synchronizer(org.mozilla.javascript.Scriptable obj)
obj
- the existing functionMethod Detail |
public java.lang.Object call(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args) throws JavaScriptException
Function
call
in interface Function
call
in class org.mozilla.javascript.Delegator
JavaScriptException
Function.call(org.mozilla.javascript.Context, org.mozilla.javascript.Scriptable, org.mozilla.javascript.Scriptable, java.lang.Object[])
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |