* Move NodeHandle->Node conversion for internal calls into run()
because it requires a Transactor thread.
This commit is contained in:
parent
181b7286d2
commit
cd047f9371
1 changed files with 18 additions and 14 deletions
|
@ -158,13 +158,25 @@ 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.
|
||||||
|
if (thisObject instanceof NodeHandle) {
|
||||||
|
thisObject = ((NodeHandle) thisObject).getNode(app.nmgr.safe);
|
||||||
|
// If no valid node object return immediately
|
||||||
|
if (thisObject == null) {
|
||||||
|
done = true;
|
||||||
|
reqtype = NONE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If function doesn't exist, return immediately
|
||||||
|
if (functionName.indexOf('.') < 0 &&
|
||||||
!scriptingEngine.hasFunction(thisObject, functionName)) {
|
!scriptingEngine.hasFunction(thisObject, functionName)) {
|
||||||
done = true;
|
done = true;
|
||||||
reqtype = NONE;
|
reqtype = NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Transaction name is used for logging etc.
|
// Transaction name is used for logging etc.
|
||||||
StringBuffer txname = new StringBuffer(app.getName());
|
StringBuffer txname = new StringBuffer(app.getName());
|
||||||
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue