I have an existing project built on spring.
I would like to catch calls to HibernateTemplate.save() so I define a pointcut on exec(save()), and log the time in an around advice.
I could define the aspects using spring AOP, but I can see the spring AOP only works if the object in the pointcut is a bean, but in my case, the HibernateTemplate could be created in a new() directly in existing client code.
so I have to use aspectj compiler, through maven plugin. I wonder if there are any potential conflicts for mixing spring AOP and aspectj ? —- previous developers of this project may have already used Spring AOP somewhere
Thanks
Yang
I normaly use AspectJ instead of Spring-Proxy-AOP for all my Spring Apps. To do this, you need to set some spring configruation, mostly set something like
mode="AspectJ". Once I forgot this for some of that configurations, that mean the application used AspectJ for some Aspects and Spring-Proxy-AOP for the others, and yes the application worked correct (except the cases where I really needed AspectJ instead of pring-Proxy-AOP).So from my point of view: If you have enough test cases, then give them a try.