[RSS]


NetBeans And Spring Framework

Everytime I (i.e., Jaroslav Tulach) hear about Spring's dependency injection I am wondering how close it is to Lookup and whether these two could be merged somehow. The answer is that they could, just find a reason to do that and time to implement the bridge. This page is my little effort to start both:

Provide via Lookup instances constructed by Spring

This could be very useful to let people who speak Spring to provide services to other NetBeans modules that are completely Spring unaware. This would very likely require one global spring's ApplicationContext to be read from some configuration files, potentially provided by via designated layer folder, to which the Lookup.getDefault() would delegate.

Allow people to use Spring inside of NetBeans

People who want to use spring managed classes inside of NetBeans rich client applications might be interested in this. Basically there is not much to do about this from the side of NetBeans, just convince the spring context to load classes from the right classloader - e.g. Thread.getContextCL(), plus somehow allow weaving of classfiles

Provide NetBeans registered instances to Spring

Opposite to task number 1, people would be able to create an ApplicationContext with instances taken from a Lookup. This would allow people to use declarative dependency of injection syntax inside of their classes and fill it with content that would otherwise be obtained by the Lookup. We wanted to provide a declarative syntax anyway - e.g. @ServiceExport and @ServiceImport, so this would be reasonable replacement, together with the fact that it uses well know syntax that is familiar to server side programmers.

Early Experiments

In Geertjan's blog, very experimental stuff