I have this in my context:
<bean id="queueSource" class="org.springframework.jndi.JndiObjectFactoryB ean">
<property name="jndiName" value="jms/foo/TopicConnectionFactory" />
<property name="resourceRef" value="true" />
</bean>
I want to inject that into my other bean:
<bean id="test" class="com.acme.Foo">
<constructor-arg ref="queueSource" />
</bean>
The queueSource is looking at an ActiveMQConnectionFactory defined in JNDI. Basically what I really need is for the "com.acme.Foo" object to have the broker URL of the connection factory. However, javax.jms.ConnectionFactory interface doesn't provide access to it and I didn't want to change my code to use an ActiveMQConnectionFactory (i.e. trying to stick to using interfaces), but I need the broker URL.
So I thought I'd pass in the "queueSource" of type JndiObjectFactoryBean so I could get the info I needed without directly referencing ActiveMQ in my code....but I get an error because Spring is trying to pass my constructor the ActiveMQConnectionFactory instead of the JndiObjectFactoryBean.
How can I get the JndiObjectFactoryBean object?


Reply With Quote
