我有一个弹簧配置文件,其中有一个bean列表。在我的程序中,我使用此配置文件来启动这些服务(bean)。我正在开始一项服务。这就是它的样子:
<bean class="java.util.ArrayList" id="configEntries">
<constructor-arg>
<list>
<ref bean="TestService1" />
<ref bean="TestService2" />
<ref bean="TestService3" />
<ref bean="TestService4" />
</list>
</constructor-arg>
</bean>
现在我想开始多个并行的这些服务。例如,同时启动TestService1四次。无论如何,我可以将这些bean组合在一起,比如列表中的列表吗?
<list>
<list>
<ref bean="TestService1" />
<ref bean="TestService1" />
<ref bean="TestService1" />
<ref bean="TestService1" />
</list>
<list>
<ref bean="TestService2" />
<ref bean="TestService2" />
<ref bean="TestService2" />
<ref bean="TestService2" />
</list>
<list>
<ref bean="TestService3" />
<ref bean="TestService3" />
<ref bean="TestService3" />
<ref bean="TestService3" />
</list>
<list>
<ref bean="TestService4" />
<ref bean="TestService4" />
<ref bean="TestService4" />
<ref bean="TestService4" />
</list>
</list>
答案 0 :(得分:-1)
<list>
<value>
<list>...</list>
</value>
<value>
<list>...</list>
</value>
<value>
<list>...</list>
</value>
</list>