[HUDSON-5360] add a new classloader ("a la" child first for plugin)

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@35076 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
olamy committed 2010-09-21 21:33:24 +00:00
1 parent 21d7e2615f
commit fded8ce6d0
4 files changed
+129 -4

No files matched your search

@@ -170,13 +170,28 @@ public class ClassicPluginStrategy implements PluginStrategy {
ClassLoader dependencyLoader = new DependencyClassLoader(getBaseClassLoader(atts), archive, Util.join(dependencies,optionalDependencies));
return new PluginWrapper(pluginManager, archive, manifest, baseResourceURL,
createClassLoader(paths, dependencyLoader), disableFile, dependencies, optionalDependencies);
createClassLoader(paths, dependencyLoader, atts), disableFile, dependencies, optionalDependencies);
}
@Deprecated
protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent) throws IOException {
return createClassLoader( paths, parent, null );
}
/**
* Creates the classloader that can load all the specified jar files and delegate to the given parent.
*/
protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent) throws IOException {
protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent, Attributes atts) throws IOException {
if (atts != null) {
String usePluginFirstClassLoader = atts.getValue( "PluginFirstClassLoader" );
if (Boolean.valueOf( usePluginFirstClassLoader )) {
PluginFirstClassLoader classLoader = new PluginFirstClassLoader();
classLoader.setParentFirst( false );
classLoader.setParent( parent );
classLoader.addPathFiles( paths );
return classLoader;
}
}
if(useAntClassLoader) {
// using AntClassLoader with Closeable so that we can predictably release jar files opened by URLClassLoader
AntClassLoader2 classLoader = new AntClassLoader2(parent);