|
|
@ -718,6 +718,13 @@ public class DefaultPluginManager implements PluginManager { |
|
|
|
return new DefaultExtensionFactory(); |
|
|
|
return new DefaultExtensionFactory(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Add the possibility to override the PluginClassLoader. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
protected PluginClassLoader createPluginClassLoader(PluginDescriptor pluginDescriptor) { |
|
|
|
|
|
|
|
return new PluginClassLoader(this, pluginDescriptor, getClass().getClassLoader()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initialize() { |
|
|
|
private void initialize() { |
|
|
|
plugins = new HashMap<>(); |
|
|
|
plugins = new HashMap<>(); |
|
|
|
pluginClassLoaders = new HashMap<>(); |
|
|
|
pluginClassLoaders = new HashMap<>(); |
|
|
@ -765,13 +772,15 @@ public class DefaultPluginManager implements PluginManager { |
|
|
|
|
|
|
|
|
|
|
|
// load plugin
|
|
|
|
// load plugin
|
|
|
|
log.debug("Loading plugin '{}'", pluginPath); |
|
|
|
log.debug("Loading plugin '{}'", pluginPath); |
|
|
|
PluginLoader pluginLoader = new PluginLoader(this, pluginDescriptor, pluginDirectory, pluginClasspath); |
|
|
|
PluginClassLoader pluginClassLoader = createPluginClassLoader(pluginDescriptor); |
|
|
|
|
|
|
|
log.debug("Created class loader '{}'", pluginClassLoader); |
|
|
|
|
|
|
|
PluginLoader pluginLoader = new PluginLoader(pluginDirectory, pluginClassLoader, pluginClasspath); |
|
|
|
pluginLoader.load(); |
|
|
|
pluginLoader.load(); |
|
|
|
log.debug("Loaded plugin '{}'", pluginPath); |
|
|
|
log.debug("Loaded plugin '{}'", pluginPath); |
|
|
|
|
|
|
|
|
|
|
|
// create the plugin wrapper
|
|
|
|
// create the plugin wrapper
|
|
|
|
log.debug("Creating wrapper for plugin '{}'", pluginPath); |
|
|
|
log.debug("Creating wrapper for plugin '{}'", pluginPath); |
|
|
|
PluginWrapper pluginWrapper = new PluginWrapper(pluginDescriptor, pluginPath, pluginLoader.getPluginClassLoader()); |
|
|
|
PluginWrapper pluginWrapper = new PluginWrapper(pluginDescriptor, pluginPath, pluginClassLoader); |
|
|
|
pluginWrapper.setPluginFactory(pluginFactory); |
|
|
|
pluginWrapper.setPluginFactory(pluginFactory); |
|
|
|
pluginWrapper.setRuntimeMode(getRuntimeMode()); |
|
|
|
pluginWrapper.setRuntimeMode(getRuntimeMode()); |
|
|
|
|
|
|
|
|
|
|
@ -796,7 +805,6 @@ public class DefaultPluginManager implements PluginManager { |
|
|
|
unresolvedPlugins.add(pluginWrapper); |
|
|
|
unresolvedPlugins.add(pluginWrapper); |
|
|
|
|
|
|
|
|
|
|
|
// add plugin class loader to the list with class loaders
|
|
|
|
// add plugin class loader to the list with class loaders
|
|
|
|
PluginClassLoader pluginClassLoader = pluginLoader.getPluginClassLoader(); |
|
|
|
|
|
|
|
pluginClassLoaders.put(pluginId, pluginClassLoader); |
|
|
|
pluginClassLoaders.put(pluginId, pluginClassLoader); |
|
|
|
|
|
|
|
|
|
|
|
return pluginWrapper; |
|
|
|
return pluginWrapper; |
|
|
|