Archive for the AOP category

Alef Arendsen

Source for demos shown at NL-JUG session June 13th 2007

Yesterday, Joris and I gave a session at the Dutch Java Users Group. We did the session twice and had about 250 people in total attending the sessions. A lot of people asked for the code for the demos we did during the sessions. Attached you'll find the code for the AOP and Dependency Injection Read more…

Mark Fisher

Customizing Annotation Configuration and Component Detection in Spring 2.1

NOTE: This post has been updated as of May 31, 2007 to reflect the state of the 2.1-M2 official release Two weeks ago I blogged about the new annotation-driven dependency injection capabilities of Spring 2.1, and I mentioned that I would follow-up with more info "later in the week". It turns out that was a Read more…

Mark Fisher

Annotation-Driven Dependency Injection in Spring 2.1

Spring 2.0 introduced annotation support and annotation-aware configuration options that can be leveraged by Spring users who are developing with Java 5 (or later versions): @Transactional for demarcating and configuring transaction definitions @Aspect (AspectJ) for defining aspects along with @Pointcut definitions and advice (@Before, @After, @Around) @Repository for indicating a class that is operating as Read more…

Ben Hale

AOP Context Binding With Named Pointcuts

There a a ton of new features in Spring AOP including the AspectJ pointcut language, the <aop:*/> namespace, and the @AspectJ syntax support. But by far one of the most powerful aspects (forgive the pun) is the AOP context binding. For example, let's say you want to advise a method that takes a String as Read more…

Alef Arendsen

CarPlant not accepting null CarModels

Last Friday I finished a training session at a client of ours. Because I had some time to kill in the hotel I was staying in, I polished the sample application I coded up during the training to post it online for the guys of the training. Usually I try to find a little sample Read more…

Ben Hale

Before Advice in Spring 2.0

As most of you know, one of the big improvements in Spring 2.0 is the addition of the AspectJ pointcut language and better integration with AspectJ in general. While I think everyone believes that this will be a great benefit in the long run, it has led to some issues. We've found that there are Read more…

Ben Hale

AOP Configuration Choices in Spring 2.0

There are a lot of reasons to love working at Interface21, but by far the best has to be working with the leaders of the industry. For example, one of Spring 2.0's major focus points has been on improving AOP support. We've added a new configuration namespace, the AspectJ pointcut language and support for @AspectJ Read more…

Ben Hale

Message Flow Tracing with AspectJ and JMX

In a project that I used to work on we had a system that would receive messages from a device and make decisions on whether that information would be passed to the user. There were multiple decision levels and one of the problems we always found ourselves asking was if a message was being lost Read more…

Ben Hale

Another Reason to Love Spring 2.0: Interceptor Combining

Recently I was working on a project that had a Swing client communicating via RMI to a service layer. The service layer was marked with transactions and everything seemed to work fine. However everytime we'd get an exception at the Hibernate DAO layer, Spring would turn the exception into a runtime exception and it would Read more…

Mark Fisher

POJO Aspects in Spring 2.0: A Simple Example

While the material in this post is quite simple, it will actually offer a glimpse of some rather significant new features in Spring 2.0. I hope that with a little imagination, you will be able to apply what you see here to far less trivial use cases of your own. I am going to show Read more…