Tag Archives: Aspect J

Wiring up EJBs using Spring

In my recent work, I wanted to wire up my EJB 3 Service Facades using Spring 2.5. I looked for an existing solution to get this done, and it did not turn out to be successful. So I thought of writing my own solution to overcome this using Aspect Oriented Programming (AOP).

Looking into how Spring performs its magical bean wiring, I read through the source code of Spring, and found out that Spring uses the concept of BeanConfigurer and BeanWiringInfoResolver to resolve dependencies for a POJO. Since I was interested on annotations based configuration, I read through the code and found that AnnoationBeanWiringInfoResolver is capable of doing the wiring up for any POJO, by reading through present annotations for that type.

However, since I wanted to make sure that only my EJBs will be wired up using this approach, I decided to extend the AnnotationBeanWiringInfoResolver to provide my own implementation which only does this special treatment.
Continue reading