Apache Tomcat 7.0.28

org.apache.jasper.servlet
Class JasperLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by 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).

Author:
Anil K. Vijendran, Harish Prabandham, Jean-Francois Arcand

Constructor Summary
JasperLoader(URL[] urls, ClassLoader parent, PermissionCollection permissionCollection)
           
 
Method Summary
 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.
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, findResource, findResources, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JasperLoader

public JasperLoader(URL[] urls,
                    ClassLoader parent,
                    PermissionCollection permissionCollection)
Method Detail

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.

Overrides:
loadClass in class ClassLoader
Parameters:
name - Name of the class to be loaded
Throws:
ClassNotFoundException - if the class was not found

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. 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.

Overrides:
loadClass in class ClassLoader
Parameters:
name - Name of the class to be loaded
resolve - If true then resolve the class
Throws:
ClassNotFoundException - if the class was not found

getResourceAsStream

public InputStream getResourceAsStream(String name)
Delegate to parent

Overrides:
getResourceAsStream in class ClassLoader
See Also:
ClassLoader.getResourceAsStream(java.lang.String)

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.

Overrides:
getPermissions in class URLClassLoader
Parameters:
codeSource - Code source where the code was loaded from
Returns:
PermissionCollection for CodeSource

Apache Tomcat 7.0.28

Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.