if (_logger.isTraceEnabled()) {
_logger.trace("Ignore " + definition + " as it's not intent to be handled with custom auditors");
}
return target;
}
ProcessDefinition process = (ProcessDefinition) definition;
Map<String, Auditor> auditors = context.getRegistry().lookupByType(Auditor.class);
if (auditors != null) {
List<Auditor> wrappers = new ArrayList<Auditor>();
for (Entry<String, Auditor> entry : auditors.entrySet()) {
if (matches(entry.getValue(), process)) {
if (_logger.isTraceEnabled()) {
_logger.trace("Found matching auditor " + entry.getKey() + " for processing step " + process.getRef());
}
wrappers.add(entry.getValue());
}
}
if (wrappers.size() > 0) {
List<Processor> processors = new ArrayList<Processor>();
CompositeAuditor auditor = new CompositeAuditor(wrappers);
Processors step = Processors.valueOf(process.getRef());
processors.add(new BeforeProcessor(step, auditor));
processors.add(target);
processors.add(new AfterProcessor(step, auditor));
return new Pipeline(context, processors);
}