可变的春天与常规豆

时间:2015-06-07 22:40:47

标签: spring groovy

是否有办法配置spring容器以在groovy sources文件夹中查找多个bean,并具有可重新加载的功能。 我知道可以使用xml配置以可重用的方式逐个配置groovy bean,即:

<beans>

    <!-- this bean is now refreshable due to the presence of the refresh-check-delay attribute -->
    <lang:groovy id="messenger"
            refresh-check-delay="5000" <!-- switches refreshing on with 5 seconds between checks -->
            script-source="classpath:Messenger.groovy">
        <lang:property name="message" value="I Can Do The Frug" />
    </lang:groovy>

    <bean id="bookingService" class="x.y.DefaultBookingService">
        <property name="messenger" ref="messenger" />
    </bean>

</beans>

谢谢Luis Oscar

0 个答案:

没有答案