* Move NodeHandle->Node conversion for internal calls into run()

because it requires a Transactor thread.
This commit is contained in:
hns 2006-02-09 12:54:29 +00:00
parent 181b7286d2
commit cd047f9371

View file

@ -158,12 +158,24 @@ public final class RequestEvaluator implements Runnable {
// avoid going into transaction if called function doesn't exist. // avoid going into transaction if called function doesn't exist.
// this only works for the (common) case that method is a plain // this only works for the (common) case that method is a plain
// method name, not an obj.method path // method name, not an obj.method path
if (reqtype == INTERNAL && if (reqtype == INTERNAL) {
functionName.indexOf('.') < 0 && // if object is an instance of NodeHandle, get the node object itself.
!scriptingEngine.hasFunction(thisObject, functionName)) { if (thisObject instanceof NodeHandle) {
done = true; thisObject = ((NodeHandle) thisObject).getNode(app.nmgr.safe);
reqtype = NONE; // If no valid node object return immediately
break; if (thisObject == null) {
done = true;
reqtype = NONE;
break;
}
}
// If function doesn't exist, return immediately
if (functionName.indexOf('.') < 0 &&
!scriptingEngine.hasFunction(thisObject, functionName)) {
done = true;
reqtype = NONE;
break;
}
} }
// Transaction name is used for logging etc. // Transaction name is used for logging etc.
@ -831,14 +843,6 @@ public final class RequestEvaluator implements Runnable {
Object[] args, long timeout) Object[] args, long timeout)
throws Exception { throws Exception {
initObjects(functionName, INTERNAL, RequestTrans.INTERNAL); initObjects(functionName, INTERNAL, RequestTrans.INTERNAL);
// if object is an instance of NodeHandle, get the node object itself.
if (object instanceof NodeHandle) {
object = ((NodeHandle) object).getNode(app.nmgr.safe);
// If no valid node object return immediately
if (object == null) {
return null;
}
}
thisObject = object; thisObject = object;
this.functionName = functionName; this.functionName = functionName;
this.args = args; this.args = args;