List<TransformMethodSignature> signatures = transformation.findMethodsWithAnnotation(Log.class);
if (signatures.isEmpty()) return;
// Re-use the logging advice from LoggingDecorator
final MethodAdvice loggingAdvice = new LoggingAdvice(model.getLogger(), exceptionTracker);
// ... but wrap it for use at the component level.
ComponentMethodAdvice advice = new ComponentMethodAdvice()
{
public void advise(ComponentMethodInvocation invocation)
{
loggingAdvice.advise(invocation);
}
};
for (TransformMethodSignature signature : signatures)
transformation.advise(signature, advice);