implemented direct callback into evaluator by its own thread.

This commit is contained in:
hns 2001-09-08 17:48:39 +00:00
parent fe7380600b
commit 7d4cbdeb48

View file

@ -652,6 +652,15 @@ public class RequestEvaluator implements Runnable {
return result; return result;
} }
protected Object invokeDirectFunction (Object obj, String functionName, Object[] args) throws Exception {
ESObject eso = getElementWrapper (obj);
ESValue[] esv = args == null ? new ESValue[0] : new ESValue[args.length];
for (int i=0; i<esv.length; i++)
esv[i] = ESLoader.normalizeValue (args[i], evaluator);
ESValue retval = eso.doIndirectCall (evaluator, eso, functionName, esv);
return retval.toJavaObject ();
}
public synchronized Object invokeFunction (Object node, String functionName, Object[] args) public synchronized Object invokeFunction (Object node, String functionName, Object[] args)
throws Exception { throws Exception {
ESObject obj = null; ESObject obj = null;
@ -877,8 +886,9 @@ public class RequestEvaluator implements Runnable {
ObjectPrototype op = getPrototype (prototypeName); ObjectPrototype op = getPrototype (prototypeName);
if (op == null) if (op == null)
op = esNodePrototype; op = esNodePrototype;
return new ESGenericObject (op, evaluator, e); return new ESGenericObject (op, evaluator, e);
} }