Tag Archive for 'aop'

Introducing Spring IDE Screen Casts

Today I uploaded three new screen casts that should help getting started with Spring IDE.

If - after watching the casts - you feel like you need to install Spring IDE make sure that you follow the installation instructions.

Last Minute Features for 2.0

Due to a bug in one of Spring IDE’s validation rule that was fixed post-RC1 and a small glitch in Spring’s AOP namespace handler implementation, our latest nightly build ships a Spring 2.1 OSGi bundle. Therefore we could enable the support for two additional features that were already implemented.

The AOP feature now supports Spring 2.1’s new bean(<name pattern>) pointcut primitive that enables you to specifiy a certain bean or a set of beans for pointcut matching. For example the pointcut definition

<aop:pointcut expression="bean(serviceBean)" />

would only match on a bean named serviceBean. Certainly you can combine the bean pointcut primitive with any other primitive that is supported by Spring. It even works for @AspectJ-style aspects.

The second and last new feature - we are now feature complete for the 2.0 stream - is support for <context:component-scan />. Read Mark’s blog for more information on this new feature. Beans created by the class path scanning infrastructure are recognized by Spring IDE and handled as normal beans; though they are visually marked with an @ icon decoration.

Spring IDE M3 - Web Flow support has arrived

Finally, after more than two years, Spring IDE adds comprehensive support Spring Web Flow. The Web Flow support is part of the today released M3 of Spring IDE 2.0. The build is available on the update site. For more information about the Web Flow support visit Web Flow Editor Usage.
<
But the Web Flow support is only one of several new additions. Here is compiled list of the new features of M3:

Web Flow support

  • Added content assist and hyperlink navigation for Spring Web Flow flow definition files and flow namespace in Spring 2.0 namespace-enabled bean configuration files #95 in Web Flow XML Editor (this was a two years old ticket, yeah!)
  • Graphical Editor for creating and editing Spring Web Flow configuration files #174, #253

Web Flow Editor

Spring Beans support

  • Extended Beans Core Model to support Spring collection types #486
  • Now inner beans and collection types are shown in Beans Explorer and Project Explorer
  • Added support for problem marker decoration on every model element #496
  • Added extension points to contribute extensions for custom Spring namespaces #474

Spring Beans search

  • Integrated into JDT’s class reference search (Shift+Ctrl+G) #495

Spring AOP support

Refactoring support

  • Spring IDE install refactoring participants for Java class rename and move, package rename and property rename refactorings #481
  • Beans XML Editor enables Java refactorings for Bean class rename and move and property rename; select a bean or property element and hit the common key bindings Crtl+Alt+R and Crtl+Alt+V #482
  • Support for refactoring Bean ids #232

Refactoring participant

Insights of Spring IDE’s AOP support

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.

Spring IDE 2.0 M2 released

Torsten and I are pleased to announce that the second milestone of Spring IDE 2.0 has just been released. The release is available from the developer update site at http://springide.org/updatesite_dev.

If you haven’t installed and tested the first milestone head over to New features in Spring IDE 2.0 M1 and read what you have missed so far.

To get some more details of what went into M2 check out the Release 2.0 M2 roadmap entry. Most significantly we have added some more features to the AOP support. Spring IDE now ships support for AJDT’s visualiser, inter-type declarations and Spring’s advisor concept. Talking about support for the <aop:advisor /> element it is interesting to note that Spring IDE is now capable to show you every Spring bean that is wrapped by a transactional proxy given that you use <tx:advice /> to define your transaction attributes.

I will probably post more on the AOP support later this week, incl. some screen shots.

Update: I’ve put together a new entry that demonstrates the AOP festures. You can find the entry at SpringideAopShowcase.