Hello,
I have defined two aspects in my basic applicationContext xml file:
The pointcut expression for loggingAspect is different for different instances of application. So I want to overwrite the loggingAspect in BeanFactoryPostProcessor. So I take new loggingAspect definition:Code:<aop:config> <aop:aspect id="decoratorAspect" ref="decorator"> <aop:pointcut expression="execution(* com.example.*.*(..))" id="pointcutDecorator"/> <aop:before method="before" pointcut-ref="pointcutDecorator"/> <aop:after-returning method="after" pointcut-ref="pointcutDecorator"/> </aop:aspect> <aop:aspect id="loggingAspect" ref="logging"> <aop:pointcut expression="execution(* com.example.*.*(..))" id="pointcutLogging"/> <aop:before method="before" pointcut-ref="pointcutLogging"/> <aop:after-returning method="after" pointcut-ref="pointcutLogging"/> </aop:aspect> </aop:config>
and register it in beanFactory. But then only the loggingAspect is invoked. The decoratorAspect is not invoked. How can I overwrite or add new aspects to the applicationContext?Code:<aop:config> <aop:aspect id="loggingAspect" ref="logging"> <aop:pointcut expression="execution(* com.example.specified.*(..))" id="pointcutLogging"/> <aop:before method="before" pointcut-ref="pointcutLogging"/> <aop:after-returning method="after" pointcut-ref="pointcutLogging"/> </aop:aspect> </aop:config>
Thanks for your help


Reply With Quote
