You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Massimo Lusetti <ml...@gmail.com> on 2007/03/29 15:19:19 UTC

Best method to wire up Spring beans

I was in the need of access beans from a Spring Bean Factory from my
own HiveMind services.

I decided to go with the DefaultSpringBeanFactoryHolder mechanism
instead of making my own.
For achieving this i created a 'dummy' services used as a builder for
the actual ApplicationContext and as a placeholder for the
hivemind.lib.DefaultSpringBeanFactoryHolder service which is injected
into it by HiveMind itself.
Then in the 'dummy' service when the holder is injected (setter
method) i have the opportunity to set the actualy BeanFactory into the
holder itself.

I needed to use the EagerLoad configuration for loading the 'dummy'
service asap just to build-up spring and wire it into the holder.

I successfully wire up the whole stuff but now i want to know if
someone could/would suggest me a smarter way.

This is all about HiveMind 1.1.1

Thanks
-- 
Massimo
http://meridio.blogspot.com

Re: Best method to wire up Spring beans

Posted by Achim Hügen <ac...@gmx.de>.
Sounds like a valid approach.

In the case of a web application it might be possible
to init spring and hivemind in a servlet listener and announce
the beanfactory to the holder there too.

Achim

Am Thu, 29 Mar 2007 15:19:19 +0200 schrieb Massimo Lusetti  
<ml...@gmail.com>:

> I was in the need of access beans from a Spring Bean Factory from my
> own HiveMind services.
>
> I decided to go with the DefaultSpringBeanFactoryHolder mechanism
> instead of making my own.
> For achieving this i created a 'dummy' services used as a builder for
> the actual ApplicationContext and as a placeholder for the
> hivemind.lib.DefaultSpringBeanFactoryHolder service which is injected
> into it by HiveMind itself.
> Then in the 'dummy' service when the holder is injected (setter
> method) i have the opportunity to set the actualy BeanFactory into the
> holder itself.
>
> I needed to use the EagerLoad configuration for loading the 'dummy'
> service asap just to build-up spring and wire it into the holder.
>
> I successfully wire up the whole stuff but now i want to know if
> someone could/would suggest me a smarter way.
>
> This is all about HiveMind 1.1.1
>
> Thanks