Jan 17th, 2007, 09:52 AM
Pluggable Spring-based Components
I'm building a plugg-able architecture comprised of a runtime 'platform' that provides the majority of services, and a plugin API that supports the addition of plugins post-deployment. I need the plugins to be able to reference beans defined in the 'platform'.
My plan was to have the 'platform' discover all the Spring config files defined by plugins at startup and build a single ApplicationContext comprised of all the beans defined by all plugins, specifying the ApplicationContext of the 'platform' as its parent.
Does this make sense? Is there a better/easier way? Does anyone have experience building pluggable architectures using Spring?
Jan 17th, 2007, 09:54 AM
Although I don't think its been released yet, have you looked into Spring OSGI?
Jan 17th, 2007, 10:01 AM
I think ultimately this is exactly what I was looking for. I was introduced to OSGI back when I was writing an Eclipse RCP application. It's a very nice framework, but a bit of a heavywieght.
Unfortunately I've got schedule constraints that force me to work with what I have.
I guess my question is whether the existance of Spring OSGI implies that what I am trying to do is going to be difficult or impossible?
Jan 17th, 2007, 10:02 AM
...also, OSGI supports hot-deployment, which is less important to me. I'm fine with restarting my app to activate a new plugin.
Jan 17th, 2007, 10:08 AM
If all you want to do is load lots of context files then thats pretty simple. This thread a couple of days ago talked about the same thing. The other thing with yours is the location being dynamic. Resources do support wildcards though.