log.debug("Executing action {} for user {}.", actionName, principal.getAccountId());
// execute (or not) based on type of bean
if (springBean instanceof ServiceAction)
{
ServiceAction action = (ServiceAction) springBean;
if (readOnly && !action.isReadOnly())
{
throw new ExecutionException(String.format("Action '%s' is not read-only.", actionName));
}
return serviceActionController.execute(actionContext, action);
}
else if (springBean instanceof TaskHandlerServiceAction)
{
TaskHandlerServiceAction action = (TaskHandlerServiceAction) springBean;
if (readOnly && !action.isReadOnly())
{
throw new ExecutionException(String.format("Action '%s' is not read-only.", actionName));
}
return serviceActionController.execute(actionContext, action);
}