I have the following xml based AOP code
<aop:config>
<aop:pointcut id="handlerMethodAop"
expression="execution(@org.springframework.web.bind.annotation.RequestMapping * *(..))" />
<aop:advisor pointcut-ref="handlerMethodAop"
advice-ref="handlerMethodAdvice" />
<aop:advisor pointcut-ref="handlerMethodAop"
advice-ref="handlerMethodThrowsAdvice" />
<aop:advisor pointcut-ref="handlerMethodAop"
advice-ref="warningThrowsAdvice" />
</aop:config>
The values in the advice-ref attributes are beans I have declared elsewhere.
How can I convert this to Java Config? 90% of my app is already using Java config so I don't need a lesson in the basics of how to do that, specifically just how to configure this AOP stuff.
@Aspect
components instead of advisors.@Configuration
elements such as @EnableAspectJAutoProxy
instead of XML configuration.See Spring AOP manual.