Hi,
What I want to do is Declare the two Objects in the XML file as types prototype.
Then I want to get A reference to ObjectA through the spring BeanFactory but passing in a single dynamic value to the constructors. The dynamic value can be anything really and is exactly that dynamic.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
">
<bean class="com.somecomp.ObjectA" id="objectA" scope="prototype" lazy-init="true">
<constructor-arg type="com.somecomp.ObjectB" ref="objectB"/>
</bean>
<!-- Message Managers -->
<bean class="com.somecomp.ObjectB" id="objectB" scope="prototype" lazy-init="true">
<constructor-arg type="java.lang.String" value="someValue"/>
</bean>
</beans>
Then what I wanted to do was to replace the above "someValue" with my dynamic value and call
Code:
BeanFactory.getBean("objectA")
but wanting to get whatever value I pass in or set into ObjectB.
. It is not possible to pre-configure a list of beans in the XML