ColdSpring works a little differently when factory-bean is used. ColdSpring calls the factory to get an instance of MyGateway. To do this it uses the constructor-arg you defined. You cannot also define properties since the ReactorGateway is actually responsible for creating the object and returning to ColdSpring which then can inject that created object into another object. Currently I don't believe we support also passing in properties since we get that object from the external factory.

Can I ask in what situation you would find this useful? What you trying to inject in your Reactor created gateway?

--Kurt

On 3/22/06, Matthew Lesko <[EMAIL PROTECTED]> wrote:
All,

I am using Coldspring to instantiate reactor beans via the
"factory-method/factory-bean" attributes, but am running into problem
when trying to specify a "property" child node.

So here is the ReactorFactory bean:

<bean id="reactorFactory" class="reactor.reactorFactory">
        <constructor-arg name="configuration">
            <value>reactorConfigFile.xml</value>
        </constructor-arg>
</bean>

Then here is an example of a bean I create using Reactor as the factory:

<bean id="MyGateway" factory-bean="reactorFactory"
factory-method="createGateway">
    <constructor-arg name="objectAlias">
        <value>DBObjectName</value>
    </constructor-arg>
    <property name="myProperty">
        <value>myValue</value>
    </property>
</bean>

When I use the getMyProperty method of this object it doesn't return
"myValue" as I would expect.

Is this a bug? Or if not, can anyone suggest a solution for how to set
properties of factory generated beans?

Regards,

Matthew Lesko


Reply via email to