Class PluginFirstClassLoader2
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- JenkinsClassLoader
WEB-INF/lib/*.jar and WEB-INF/classes
 directories and the Jenkins core class loader (in that order).
 To use this class loader, set pluginFirstClassLoader to true in the 
 maven-hpi-plugin configuration.
- Author:
- Basil Crow
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetResource(String name) Find the resource with the given name.getResources(String name) Find all the resources with the given name.protected Class<?> Load the class with the specified binary name.Methods inherited from class jenkins.util.URLClassLoader2addURL, findClass, findLoadedClass2, getClassLoadingLockMethods inherited from class java.net.URLClassLoaderclose, definePackage, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoaderdefineClass, defineClassMethods inherited from class java.lang.ClassLoaderclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignersMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jenkins.util.JenkinsClassLoaderfindResource, findResources
- 
Constructor Details- 
PluginFirstClassLoader2
 
- 
- 
Method Details- 
loadClassLoad the class with the specified binary name. This method searches for classes in the following order:- 
       Invoke ClassLoader.findLoadedClass(String)to check if the class has already been loaded.
- 
       Invoke URLClassLoader2.findClass(String)to find the class.
- 
       Invoke ClassLoader.loadClass(String)on the parent class loader.
 If the class was found using the above steps and the resolveflag is true, this method will then invokeClassLoader.resolveClass(Class)on the resultingClassobject.This method synchronizes on the result of URLClassLoader2.getClassLoadingLock(String)during the entire class loading process.- Overrides:
- loadClassin class- ClassLoader
- Parameters:
- name- The binary name of the class
- resolve- If- truethen resolve the class
- Returns:
- The resulting Classobject
- Throws:
- ClassNotFoundException- If the class could not be found
 
- 
       
- 
getResourceFind the resource with the given name. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code.The name of a resource is a ' /'-separated path name that identifies the resource. This method searches for resources in the following order:- 
       Invoke URLClassLoader.findResource(String)to find the resource.
- 
       Invoke getResource(String)on the parent class loader.
 - Overrides:
- getResourcein class- ClassLoader
- Parameters:
- name- The resource name
- Returns:
- URLobject for reading the resource;- nullif the resource could not be found, a- URLcould not be constructed to locate the resource, the resource is in a package that is not opened unconditionally, or access to the resource is denied by the security manager.
- Throws:
- NullPointerException- If- nameis- null
 
- 
       
- 
getResourcesFind all the resources with the given name. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code.The name of a resource is a /-separated path name that identifies the resource. This method first invokesURLClassLoader.findResources(String)to find the resources with the name in this class loader. Finally, it invokesgetResources(String)on the parent class loader. It returns an enumeration whose elements are theURLs found by searching theURLs found withURLClassLoader.findResources(String), followed by theURLs found by searching the parent class loader.- Overrides:
- getResourcesin class- ClassLoader
- Parameters:
- name- The resource name
- Returns:
- An enumeration of URLobjects for the resource. If no resources could be found, the enumeration will be empty. Resources for which aURLcannot be constructed, which are in a package that is not opened unconditionally, or for which access to the resource is denied by the security manager, are not returned in the enumeration.
- Throws:
- IOException- If I/O errors occur
- NullPointerException- If- nameis- null
 
 
-