Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinston Prakash2012-09-27 10:57:48 -0400
committerWinston Prakash2012-09-27 10:57:48 -0400
commit5481cc2bde2012e54ba2386211ca0e4f53cf0148 (patch)
tree69f3eeba3afd31536f7f39beccfe3179d66ac6bf
parent4ef97317a7087fc3ac31e2a25a69133eea76e07d (diff)
downloadorg.eclipse.hudson.core-5481cc2bde2012e54ba2386211ca0e4f53cf0148.tar.gz
org.eclipse.hudson.core-5481cc2bde2012e54ba2386211ca0e4f53cf0148.tar.xz
org.eclipse.hudson.core-5481cc2bde2012e54ba2386211ca0e4f53cf0148.zip
PlugnWrapperFactory should create PluginFirstClassLoader as parent of PluginClassLoader if "PluginFirstClassLoader:true" is specified in the Manifest Entry
-rw-r--r--hudson-inject/src/main/java/org/hudsonci/inject/internal/plugin/PluginWrapperFactory.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/hudson-inject/src/main/java/org/hudsonci/inject/internal/plugin/PluginWrapperFactory.java b/hudson-inject/src/main/java/org/hudsonci/inject/internal/plugin/PluginWrapperFactory.java
index d775ab83..be85146e 100644
--- a/hudson-inject/src/main/java/org/hudsonci/inject/internal/plugin/PluginWrapperFactory.java
+++ b/hudson-inject/src/main/java/org/hudsonci/inject/internal/plugin/PluginWrapperFactory.java
@@ -34,6 +34,7 @@ import java.util.List;
import java.util.jar.Attributes;
import static com.google.common.base.Preconditions.checkNotNull;
+import hudson.PluginFirstClassLoader;
/**
* Provides {@link PluginWrapper} creation facilities.
@@ -63,6 +64,16 @@ public class PluginWrapperFactory
for (File file : files) {
urls.add(file.toURI().toURL());
}
+ if (atts != null) {
+ String usePluginFirstClassLoader = atts.getValue("PluginFirstClassLoader");
+ if (Boolean.valueOf(usePluginFirstClassLoader)) {
+ PluginFirstClassLoader pluginFirstParent = new PluginFirstClassLoader();
+ pluginFirstParent.setParentFirst(false);
+ pluginFirstParent.setParent(parent);
+ pluginFirstParent.addPathFiles(files);
+ return new PluginClassLoader(urls, pluginFirstParent);
+ }
+ }
return new PluginClassLoader(urls, parent);
}
};

Back to the top