Class JasperLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.apache.jasper.servlet.JasperLoader
- All Implemented Interfaces:
Closeable, AutoCloseable
Class loader for loading servlet class files (corresponding to JSP files)
and tag handler class files (corresponding to tag files).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CodeSourceprivate ClassLoaderprivate PermissionCollectionprivate SecurityManager -
Constructor Summary
ConstructorsConstructorDescriptionJasperLoader(URL[] urls, ClassLoader parent, PermissionCollection permissionCollection, CodeSource codeSource, Map<String, byte[]> bytecodes) -
Method Summary
Modifier and TypeMethodDescriptionfinal PermissionCollectiongetPermissions(CodeSource codeSource) Get the Permissions for a CodeSource.Load the class with the specified name.Load the class with the specified name, searching using the following algorithm until it finds and returns the class.private byte[]loadClassDataFromFile(String fileName) Methods inherited from class URLClassLoader
addURL, close, definePackage, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class SecureClassLoader
defineClass, defineClassMethods inherited from class ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Field Details
-
permissionCollection
-
codeSource
-
parent
-
securityManager
-
bytecodes
-
-
Constructor Details
-
JasperLoader
public JasperLoader(URL[] urls, ClassLoader parent, PermissionCollection permissionCollection, CodeSource codeSource, Map<String, byte[]> bytecodes)
-
-
Method Details
-
loadClass
Load the class with the specified name. This method searches for classes in the same manner asloadClass(String, boolean)withfalseas the second argument.- Overrides:
loadClassin classClassLoader- Parameters:
name- Name of the class to be loaded- Throws:
ClassNotFoundException- if the class was not found
-
loadClass
Load the class with the specified name, searching using the following algorithm until it finds and returns the class. If the class cannot be found, returnsClassNotFoundException.- Call
findLoadedClass(String)to check if the class has already been loaded. If it has, the sameClassobject is returned. - If the
delegateproperty is set totrue, call theloadClass()method of the parent class loader, if any. - Call
findClass()to find this class in our locally defined repositories. - Call the
loadClass()method of our parent class loader, if any.
resolveflag istrue, this method will then callresolveClass(Class)on the resulting Class object.- Overrides:
loadClassin classClassLoader- Parameters:
name- Name of the class to be loadedresolve- Iftruethen resolve the class- Throws:
ClassNotFoundException- if the class was not found
- Call
-
findClass
- Overrides:
findClassin classURLClassLoader- Throws:
ClassNotFoundException
-
loadClassDataFromFile
-
getPermissions
Get the Permissions for a CodeSource. Since this ClassLoader is only used for a JSP page in a web application context, we just return our preset PermissionCollection for the web app context.- Overrides:
getPermissionsin classURLClassLoader- Parameters:
codeSource- Code source where the code was loaded from- Returns:
- PermissionCollection for CodeSource
-