[jboss-user] [JBoss Microcontainer] New message: "Re: Undemanding Dependencies"

Adrian Brock do-not-reply at jboss.com
Thu Jan 21 13:02:28 EST 2010


User development,

A new message was posted in the thread "Undemanding Dependencies":

http://community.jboss.org/message/521519#521519

Author  : Adrian Brock
Profile : http://community.jboss.org/people/adrian@jboss.org

Message:
--------------------------------------------------------------
I would say it should just be like any other circular dependency:
 
<bean name="A" mode="On Demand">
   <property name="b"><inject bean="B" /></property>
<bean>
 
<bean name="B" mode="On Demand">
   <demand targetState="Instantiated">A</demand>
</bean>
 
i.e. starting B triggers starting A which then gets injected with B.
 
However, the AbstractDemandMetaData$DemandDependencyItem
overrides resolve(Controller) and doesn't include the
enableOnDemand() processing.
 
So it won't work, although I think it should?
 
This alternative should work although it looks a bit funny/backwards. ;-)
 
<bean name="A" mode="On Demand"/>

<bean name="B" mode="On Demand">
   <install bean="A" method="setB">
       <parameter><this/></parameter>
   </install>
</bean>

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/521519#521519




More information about the jboss-user mailing list