In a previous post I gave our users some first details about what Spring IDE’s AOP support is going to offer.
Without further requirements Spring IDE will provide the following:
- Parsing of AspectJ Pointcut Expressions in Spring configurations. Giving you error markers if the pointcut expression is syntactically incorrect. The same is true to @AspectJ-style pointcut expressions.
- Visual markers for advised beans and advising beans and their corresponding Java classes and methods. That works for Spring AOP configuration using the
<aop:config />and<aop:advisor />elements and for @AspectJ-style aspects and<aop:aspectj-autoproxy>. - To actual see what bean advises what other bean, we provide our own Beans Cross References View. This view visualizes your Spring AOP configuration and will allow the navigation between participating Spring Beans and Java classes. Furthermore the view will refresh automatically if you select another element either in the Java Editor or the Beans XML Editor and present the Beans Cross References for the selected scope.
If you have the AspectJ Development Tools installed you can get even more:
- Reference contributions to AJDT’s Cross Reference View. Make sure that you enable Spring IDE’s provider in the view’s preferences.
- Custom provider for AJDT’s Visualiser to see how and where your aspect and adivsors apply across your entire project.
A note about classpath settings
To allow Spring IDE to successful do the parsing of the AOP configuration, it is crucial that the project’s class path contains all required dependencies. The Spring IDE AOP parser will take your project’s classpath to load all classes from; Spring IDE will not instantiate the classes as we only need the Class. So make sure that the class path settings will allow loading an ApplicationContext from the configuration file. E.g. just execute a small JUnit to verify this; successful compilation isn’t enough as we need to load the classes including all their dependencies.
Showcasing the features
Most of you might know the JPetStore sample application and especially the implementation shipped with the Spring Framework. I’ll take this project to demonstrate the AOP support features.
First let’s start of having a look at the Spring configuration file that takes the definition of application’s business layer. Including transaction boundaries and attributes as well as some AOP demo stuff for sending emails.
If you open up the file in Eclipse you should see Spring IDE AOP markers. For the sake of consistency the icons were taken from the AJDT project. Furthermore the Beans Cross References View will display the cross references of the selected element in the xml editor. Refer to the following screen shot to get a gist how that looks.
Certainly you can use the Beans Cross References View to navigate to the Java class or method that either represents the adivce or that is actually advised. For example navigate to the PetStoreImpl.insertOrder method and you’ll see that this method is around-advised by the tx:advice and the emailAdvice. Furthermore you should find the cross references in AJDT’s cross reference view-if you have the AJDT plugins .
Last but not least you can bring up AJDT’s Visualiser and enable the Spring AOP Provider in the Visualiser’s preferences. This view can give you real quick overview of what advice is executed where in your project. Sticking with the example, only the PetStoreImpl class is advised as you can see in following screen shot.





Recent Activity
Christian Dupuis, Hamed
Narada, Rakesh, Christian Dupuis, Christian Dupuis, Who Ever, KingSun, Thomas, dali, Christian Dupuis, Vinoth [...]
en3rgizer
Christian Dupuis, painfulupdate, Scott, Christian Dupuis, Randy, xe, Gabriel, coredump, Christian Dupuis, Mike Hiner [...]
Christian Dupuis, Sudar B, Daniele Gagliardi, David Dossot, asif, asif, Christian Dupuis, Christian Dupuis, Daniel Roth, asif [...]
Vinoth, Pavan, , x, x, Manish Kl, mr.tianshu, René, Xiangyang, Jeff Mutonho [...]