}
private View invokeActionMethod(Object actionController, ActionSignature actionSignature,
Class<?> actionControllerClass) throws Exception {
View view = null;
Object[] args = actionSignature.getArgs(parameterMap, request.getInputStream());
Annotation[] actionAnnotations = actionSignature.getAnnotations();
List<Object> classInterceptors = createInterceptors(controllerDb.getInterceptorsFor(actionControllerClass));
List<Object> methodInterceptors = createInterceptorsForAction(actionSignature, actionControllerClass);
for (Object interceptor : classInterceptors) {
view = invokeBeforeActionIfRequired(interceptor, actionAnnotations,
controllerDb.getBeforeActionMethodForInterceptor(interceptor.getClass()), args);
if (view != null) {
return view;
}
}
for (Object interceptor : methodInterceptors) {
view = invokeBeforeActionIfRequired(interceptor, actionAnnotations,
controllerDb.getBeforeActionMethodForInterceptor(interceptor.getClass()), args);
if (view != null) {
return view;
}
}
view = invokeBeforeActionIfRequired(actionController, actionAnnotations,
controllerDb.getBeforeActionMethodFor(actionControllerClass), args);
if (view != null) {
return view;
}
FastClass actionFastClass = controllerDb.getFastClass(actionControllerClass);
Object entity = actionFastClass.invoke(actionSignature.fastIndex(), actionController, args);
View marshalledEntity = actionSignature.marshall(entity);
view = marshalledEntity;
logger.debug("invoked " + actionSignature.methodName() + " for " + actionControllerClass.getName());
View afterActionView = invokeAfterActionIfRequired(actionController, actionAnnotations,
controllerDb.getAfterActionMethodFor(actionControllerClass),
args, entity, marshalledEntity);
if (afterActionView != null) {
view = afterActionView;
}
for (Object interceptor : methodInterceptors) {
View interceptorView = invokeAfterActionIfRequired(interceptor, actionAnnotations,
controllerDb.getAfterActionMethodForInterceptor(interceptor.getClass()),
args, entity, marshalledEntity);
if (interceptorView != null) {
view = interceptorView;
break;
}
}
for (Object interceptor : classInterceptors) {
View interceptorView = invokeAfterActionIfRequired(interceptor, actionAnnotations,
controllerDb.getAfterActionMethodForInterceptor(interceptor.getClass()),
args, entity, marshalledEntity);
if (interceptorView != null) {
view = interceptorView;
break;