private static final Logger log = LoggerFactory.getLogger(DefaultExtensionFinder.class);
protected PluginManager pluginManager;
- protected ExtensionFactory extensionFactory;
protected volatile Map<String, Set<String>> entries; // cache by pluginId
- public DefaultExtensionFinder(PluginManager pluginManager, ExtensionFactory extensionFactory) {
+ public DefaultExtensionFinder(PluginManager pluginManager) {
this.pluginManager = pluginManager;
- this.extensionFactory = extensionFactory;
}
@Override
descriptor.setExtensionClass(extensionClass);
ExtensionWrapper extensionWrapper = new ExtensionWrapper<>(descriptor);
- extensionWrapper.setExtensionFactory(extensionFactory);
+ extensionWrapper.setExtensionFactory(pluginManager.getExtensionFactory());
result.add(extensionWrapper);
log.debug("Added extension '{}' with ordinal {}", className, extension.ordinal());
} else {
return extensionFinder.findClassNames(pluginId);
}
+ @Override
+ public ExtensionFactory getExtensionFactory() {
+ return extensionFactory;
+ }
+
@Override
public RuntimeMode getRuntimeMode() {
if (runtimeMode == null) {
* Add the possibility to override the ExtensionFinder.
*/
protected ExtensionFinder createExtensionFinder() {
- DefaultExtensionFinder extensionFinder = new DefaultExtensionFinder(this, extensionFactory);
+ DefaultExtensionFinder extensionFinder = new DefaultExtensionFinder(this);
addPluginStateListener(extensionFinder);
return extensionFinder;