use of com.agiletec.apsadmin.system.BaseAction in project entando-core by entando.
the class ActionLoggerInterceptor method intercept.
@Override
public String intercept(ActionInvocation invocation) throws Exception {
ActionLogRecord actionRecord = null;
String result = null;
try {
actionRecord = this.buildActionRecord(invocation);
result = invocation.invoke();
List<ActivityStreamInfo> asiList = null;
Object actionObject = invocation.getAction();
if (actionObject instanceof BaseAction) {
BaseAction action = (BaseAction) actionObject;
asiList = action.getActivityStreamInfos();
}
if (null == asiList || asiList.isEmpty()) {
this.getActionLoggerManager().addActionRecord(actionRecord);
} else {
for (int i = 0; i < asiList.size(); i++) {
ActivityStreamInfo asi = asiList.get(i);
ActionLogRecord clone = this.createClone(actionRecord);
clone.setActivityStreamInfo(asi);
this.getActionLoggerManager().addActionRecord(clone);
}
}
} catch (Throwable t) {
_logger.error("error in intercept", t);
// ApsSystemUtils.logThrowable(t, this, "intercept");
}
return result;
}
Aggregations