Reputation: 3921
I want to change Spring AOP to pure aspectJ in spring framework.
Spring AOP is used like below.
<aop:config >
<aop:pointcut id="testopiaLogging" expression="execution(public * cosmos..*SVC.*(..))" />
<aop:aspect ref="testopiaLoggingAspect">
<aop:after-throwing method="throwError" throwing="exception" pointcut-ref="testopiaLogging"/>
<aop:after-returning method="log" returning="retVal" pointcut-ref="testopiaLogging"/>
</aop:aspect>
</aop:config>
and I'll change it to pure aspectJ accroding to below url's page
spring-aspect.jar is set in classpath.
So I made aop.xml.
<aspectj>
<weaver>
<include within="cosmos.*" />
</weaver>
<aspects>
<aspect name="com.sds.testopia.logger.aop.TestopiaAspect" />
</aspects>
</aspectj>
I want to get specific and detail explanation. thx.
Upvotes: 2
Views: 797
Reputation: 299198
AspectJ doesn't work with Spring's XML-style AOP. You need to use either traditional AspectJ (.aj) or the annotation based @AspectJ
(.java) format. But you can't create AspectJ aspects using XML (only Spring AOP aspects).
Upvotes: 2