devender.me

Spring 1.2 Java 5 Based Transaction Annotations

Colin Sampaleanu posted an excellent article on Spring 1.2’s Java 5 Based Transaction Annotations, if you want to follow this approach but don?t want the DefaultAdvisorAutoProxyCreator to pick up every available Advisor in the context, here what you can do












Create you DefaultAdvisorAutoProxyCreator as mentioned but give it a name (defaultAdvisor in this case) and set the usePrefix property to true.

Then in all the advisors that you want to be picked up, change there name to have ‘defaultAdvisor.’ prefix.

The usePrefix property tells the DefaultAdvisorAutoProxyCreator to apply only those Advisors that have a prefix of its own name.

Alternatively you can also use the AdvisorBeanNamePrefix to tell the DefaultAdvisorAutoProxyCreator what prefix to consider.

Comments

Sign in with GitHub to comment. Or just say hi on GitHub.