org.apache.jasper.servlet
Class JasperLoader
URLClassLoader
org.apache.jasper.servlet.JasperLoader
public class JasperLoader
extends URLClassLoader
Class loader for loading servlet class files (corresponding to JSP files)
and tag handler class files (corresponding to tag files).
- Anil K. Vijendran
- Harish Prabandham
- Jean-Francois Arcand
JasperLoader(URL[] urls, ClassLoader parent, PermissionCollection permissionCollection, CodeSource codeSource)
|
PermissionCollection | getPermissions(CodeSource codeSource) - Get the Permissions for a CodeSource.
|
InputStream | getResourceAsStream(String name) - Delegate to parent
|
Class | loadClass(String name) - Load the class with the specified name.
|
Class | loadClass(String name, boolean resolve) - Load the class with the specified name, searching using the following
algorithm until it finds and returns the class.
|
JasperLoader
public JasperLoader(URL[] urls,
ClassLoader parent,
PermissionCollection permissionCollection,
CodeSource codeSource)
getPermissions
public final PermissionCollection getPermissions(CodeSource codeSource)
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.
codeSource
- Code source where the code was loaded from
- PermissionCollection for CodeSource
getResourceAsStream
public InputStream getResourceAsStream(String name)
Delegate to parent
java.lang.ClassLoader.getResourceAsStream(java.lang.String)
loadClass
public Class loadClass(String name)
throws ClassNotFoundException
Load the class with the specified name. This method searches for
classes in the same manner as loadClass(String, boolean)
with false
as the second argument.
name
- Name of the class to be loaded
loadClass
public Class loadClass(String name,
boolean resolve)
throws ClassNotFoundException
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, returns
ClassNotFoundException
.
- Call
findLoadedClass(String)
to check if the
class has already been loaded. If it has, the same
Class
object is returned. - If the
delegate
property is set to true
,
call the loadClass()
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.
If the class was found using the above steps, and the
resolve
flag is
true
, this method will then
call
resolveClass(Class)
on the resulting Class object.
name
- Name of the class to be loadedresolve
- If true
then resolve the class
Copyright B) 2000-2004 Apache Software Foundation. All Rights Reserved.