|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectRhinohide
@ThreadSafe public class Rhinohide
An overlay/wrapper of a JavaScript object, based on an intermediate JSObject bridge.
Was intermittent on system/host/tinman/windows.xht, both IE and Firefox. Different failure modes, including crash of browser. Probable concurrency bug in the underlying JSObject bridge.
Moved to Java 1.6, and added memory to that Windows box. Bug has not recurred.
Field Summary | |
---|---|
protected RhiWindow |
window
|
Constructor Summary | |
---|---|
protected |
Rhinohide(netscape.javascript.JSObject jsObject)
|
|
Rhinohide(RhiWindow window,
netscape.javascript.JSObject jsObject)
Creates a Rhinohide. |
Method Summary | |
---|---|
Object |
call(String methodName,
Object... arguments)
Calls a method on the underlying JavaScript object, via the bridge. |
Object |
callV(String methodName,
Object... arguments)
Same as checkV(call(methodName, arguments)). |
static Object |
checkV(Object object)
|
boolean |
equals(Object o)
Returns true iff o is a Rhinohide, and has an 'equal' JSObject bridge. |
Object |
eval(String expression)
Evaluates an expression in the context of the underlying JavaScript object, via the bridge. |
Object |
evalV(String expression)
Same as checkV(eval(expression)). |
Object |
getMember(String name)
Returns a property of the underlying JavaScript object, via the bridge. |
Object |
getMemberV(String name)
Same as checkV(getMember(name)). |
int |
hashCode()
Defers to the bridge, returning jsObject.hashCode(). |
netscape.javascript.JSObject |
jsObject()
Bridge to underlying JavaScript object. |
void |
setMember(String name,
Object value)
Sets a property of the underlying JavaScript object, via the bridge. |
static netscape.javascript.JSObject |
toJSObject(Rhinohide rhinohide)
|
String |
toString()
Defers to the bridge, returning jsObject.toString(). |
RhiWindow |
window()
The global object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected RhiWindow window
Constructor Detail |
---|
public Rhinohide(RhiWindow window, netscape.javascript.JSObject jsObject)
window
- global objectjsObject
- bridge to underlying JavaScript object, per jsObject()protected Rhinohide(netscape.javascript.JSObject jsObject)
Method Detail |
---|
public static Object checkV(Object object)
StunnedRhinoException
- if the object is nullcallV(String,Object...)
,
evalV(String)
,
getMemberV(String)
public final netscape.javascript.JSObject jsObject()
Ordinary clients ought not to call methods of the underlying JavaScript object directly. Instead, they ought to call the equivalent methods of this Rhinohide wrapper.
public static netscape.javascript.JSObject toJSObject(Rhinohide rhinohide)
public RhiWindow window()
public Object call(String methodName, Object... arguments)
object.methodName( arguments );
public Object callV(String methodName, Object... arguments)
StunnedRhinoException
- if the result is nullpublic Object eval(String expression)
object.eval( expression );
Repeatable on system/host/tinman/windows.xht#firefox. JSObject.eval() and call() fail, after a time. Failure may occur some time into applet initialization; or after interruption by an alert box. It consistently occurs on that host for all post-init access, e.g. via RMI worker threads, or the AWT event dispatch thread.
On failure, JSObject.eval() calls no longer have effect, and always return null. And JSObject.call(method) always returns null for custom methods; those defined in page content scripts, as well as those defined in previous calls to eval().
public Object evalV(String expression)
StunnedRhinoException
- if the result is nullpublic Object getMember(String name)
object.name;
public Object getMemberV(String name)
StunnedRhinoException
- if the result is nullpublic void setMember(String name, Object value)
object.name = value;
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |