为了实现模块化方法(类似于 oSGI),我正在使用 spring 插件框架(https://github.com/spring-projects/spring-plugin),我提供了一个特定的接口作为我的插件实现的扩展点实施
首先需要做两件事:扫描类路径中的所有类并获取实现该接口的实现(扩展点)
第二:将那些实现bean添加到应用程序上下文中
第一部分 m 能够实现作为 spring 插件提供 PluginRegistry 查找给定插件类型的所有实现
registry.getPluginFor(ProductType.SOFTWARE);
// Returns the first plugin supporting SOFTWARE, or DefaultPlugin if none found
registry.getPluginFor(ProductType.SOFTWARE, new DefaultPlugin());
// Returns all plugins supporting HARDWARE, throwing the given exception if none found
registry.getPluginsFor(ProductType.HARDWARE, new MyException("Damn!");
第二部分:我现在应该如何将此 bean 列表注册到应用程序上下文,而不会引起任何冲突