I am trying to write an aspect that will do some logging whenever one of my service methods returns an instance of my domain object, or an array of my domain object. I was able to successfully intercept my domain object with no problem, but my interceptor that intercepts arrays does not seem to function. This is the code I'm using:
From what I can tell from the debugger, it looks like the second interceptor is not intercepting my method at all. Is there something wrong with my pointcut? I am currently limited to Java 1.4; otherwise I would try it with annotations.
<aop:config> <aop:aspect id="loggingAspect" ref="logger"> <aop:after-returning pointcut="execution(com.mycompany.DomainObject com.mycompany.services.MyService.*(..)" returning="domainObject" method="writeToAuditLog"/> <aop:after-returning pointcut="execution(com.mycompany.DomainObject com.mycompany.services.MyService.*(..)" returning="domainObjects" method="writeArrayToAuditLog"/> </aop:aspect> </aop:config>