我看到了如下所示的bean定义
<bean id="connectionFactoryReceiver" class="com.myutils.messaging.TopicConnectionFactoryProxy">
<property name="connectionFactory">
<bean class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="/us/UAT/eod:tcf"/>
<property name="jndiTemplate">
<ref local="jndiTemplate"/>
</property>
</bean>
</property>
<property name="login" value=""/>
<property name="password" value=""/>
</bean>
此外,TopicConnectionFactoryProxy类的设置器为
public void setConnectionFactory(final QueueConnectionFactory connectionFactory) {
if (connectionFactory == null) {
throw new NullPointerException("connection factory can't be null");
}
this.connectionFactory = connectionFactory;
}
我知道org.springframework.jndi.JndiObjectFactoryBean
可以getObject()
返回连接工厂对象。但是,可以“直接”注入它作为连接工厂类型吗?