我使用Spring Boot的PropertiesLauncher和Loader-Path:插件清单条目构建了一个小型应用程序.在plugins文件夹中有几个jar文件,其中包含Meta-INF / spring.factories.
加载我的外部插件jar的配置可以正常工作.
现在,我想知道如果类路径上的某些内容发生更改,是否以及如何刷新应用程序上下文.例如,删除或添加外部插件jar.
我已经看过SpringApplicationRunListener了,但是我想我不能通过此类来实现.
有没有想法,以及如何实现?
在2009/2010年,有Spring Dynamics Modules个项目,但有it seems abandoned now个项目.
您很可能必须自己重新实现.也许您应该研究现有的插件系统实现,例如实现OSGi的Apache Felix:
Apache Felix is a community effort to implement the OSGi Framework and Service platform and other interesting OSGi-related technologies under the Apache license. The OSGi specifications originally targeted embedded devices and home services gateways,but they are ideally suited for any project interested in the principles of modularity,component-orientation,and/or service-orientation. OSGi technology combines aspects of these aforementioned principles to define a dynamic service deployment framework that is amenable to remote management.