Yes, there is some confusion between the "singleton" property of MIFB and the singleton attribute in the xml bean element.
Originally Posted by ccudennec
As you (and Adreas) say, you don't want to have a different instance of the factoryBean itself (so no need to set "singleton=false" on the bean element) but you do want every invocation of getObject to call the method.
I believe the fragment you provided is correct:
Although I am not sure why you would want to call getMailHost multiple times???? But yes, that is the correct configuration.
<bean id="getMailHost" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" ref="globalsDao" />
<property name="singleton" value="false" />
Yes, I was replying to Andreas point
@yatesco: only saw your post after I wrote mine. I think that's the point