mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-04 23:55:52 +00:00
I want the Plugin.postInitialize() to see all the other plugins, namely PluginManager.uberClassLoader.
So this code needs to be in a separate method. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@17125 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
9f620f125b
commit
338d63a1f6
2 files changed
+12
-4
No files matched your search
@@ -158,18 +158,25 @@ public final class PluginManager extends AbstractModelObject {
|
||||
activePlugins.remove(p);
|
||||
plugins.remove(p);
|
||||
}
|
||||
}
|
||||
|
||||
for (PluginWrapper p : activePlugins.toArray(new PluginWrapper[activePlugins.size()])) {
|
||||
strategy.initializeComponents(p);
|
||||
/**
|
||||
* Called immediately after the construction.
|
||||
* This is a separate method so that code executed from here will see a valid value in
|
||||
* {@link Hudson#pluginManager}.
|
||||
*/
|
||||
public void initialize() {
|
||||
for (PluginWrapper p : activePlugins.toArray(new PluginWrapper[activePlugins.size()])) {
|
||||
strategy.initializeComponents(p);
|
||||
try {
|
||||
p.getPlugin().postInitialize();
|
||||
} catch (Exception e) {
|
||||
failedPlugins.add(new FailedPlugin(p.getShortName(),e));
|
||||
failedPlugins.add(new FailedPlugin(p.getShortName(), e));
|
||||
LOGGER.log(Level.SEVERE, "Failed to post-initialize a plug-in " + p.getShortName(), e);
|
||||
activePlugins.remove(p);
|
||||
plugins.remove(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user