MethodDeclaration method = call.getMethodDeclaration();
// Do we already have an error?
if (method == null || call.getException() != null)
{
return new Reply(call.getCallId(), null, call.getException());
}
// We don't need to check accessControl.getReasonToNotExecute()
// because the checks are made by the doExec method, but we do check
// if we can display it
accessControl.assertGeneralExecutionIsPossible(call.getScriptName(), method);
// Log the call details if the accessLogLevel is call.
if (AccessLogLevel.getValue(this.accessLogLevel, debug).hierarchy() == 0)
{
StringBuffer buffer = new StringBuffer();
buffer.append("Exec: ")
.append(call.getScriptName())
.append(".")
.append(call.getMethodDeclaration().toString());
buffer.append(", ");
buffer.append("id=");
buffer.append(call.getCallId());
Loggers.ACCESS.info(buffer.toString());
}
Object reply = module.executeMethod(method, call.getParameters());
return new Reply(call.getCallId(), reply);
}
catch (SecurityException ex)
{
writeExceptionToAccessLog(ex);
// If we are in live mode, then we don't even say what went wrong
if (debug)
{
return new Reply(call.getCallId(), null, ex);
}
else
{
return new Reply(call.getCallId(), null, new SecurityException());
}
}
catch (InvocationTargetException ex)
{
// Allow Jetty RequestRetry exception to propagate to container
Continuation.rethrowIfContinuation(ex);
writeExceptionToAccessLog(ex.getTargetException());
return new Reply(call.getCallId(), null, ex.getTargetException());
}
catch (Exception ex)
{
// Allow Jetty RequestRetry exception to propagate to container
Continuation.rethrowIfContinuation(ex);
writeExceptionToAccessLog(ex);
return new Reply(call.getCallId(), null, ex);
}
}