pipeline.authorize(invocation, ctx, inContext( function(err, allowed){
if(err) return handleError(err);
logger.debug("authorized: ", allowed);
if(!allowed) return handleError("Access Denied");
pipeline.resolveTarget(invocation, ctx, inContext(function(err, target){
if(err) return handleError(err);
if(!target) return handleError("Unable to resolve target");
invocation.target = target;
pipeline.resolveArguments(invocation, ctx, inContext(function(err, args){
if(err) return handleError(err);
invocation.args = args;
pipeline.invoke(invocation, ctx , inContext(function(ex, invocationResult){
if(ex) return handleError(ex);
pipeline.redact(invocation, ctx, invocationResult, inContext(function(err, redactionResult){
if(err) return handleError(err);
pipeline.pack(invocation, ctx, redactionResult, inContext(function(err, packedData){
if(err) return handleError(err);
res.send(200, packedData);
sent = true;
logger.debug("====== END RMI Success Result #", seqnum, " DONE: ", packedData);
}));
}))
}));
}))
}))
}));
var tmout = setTimeout(function(){
if(sent) return;
var msg = "Timeout occurred when processing call "+invocation.clazz +"." + invocation.method;
logger.error(msg, seqnum);
handleError(msg);