org.openqa.jetty.http
Class ContextLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by org.openqa.jetty.http.ContextLoader

public class ContextLoader
extends URLClassLoader

ClassLoader for HttpContext. Specializes URLClassLoader with some utility and file mapping methods. This loader defaults to the 2.3 servlet spec behaviour where non system classes are loaded from the classpath in preference to the parent loader. Java2 compliant loading, where the parent loader always has priority, can be selected with the setJava2Complient method.

Version:
$Id: ContextLoader.java,v 1.37 2006/01/09 07:26:12 gregwilkins Exp $
Author:
Greg Wilkins (gregw)

Constructor Summary
ContextLoader(HttpContext context, String classPath, ClassLoader parent, PermissionCollection permisions)
          Constructor.
 
Method Summary
 void destroy()
           
 PermissionCollection getPermissions(CodeSource cs)
           
 URL getResource(String name)
           
 boolean isJava2Compliant()
           
 boolean isServerPath(String name)
           
 boolean isSystemPath(String name)
           
 Class loadClass(String name)
           
protected  Class loadClass(String name, boolean resolve)
           
 void setJava2Compliant(boolean compliant)
          Set Java2 compliant status.
 String toString()
           
 
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, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContextLoader

public ContextLoader(HttpContext context,
                     String classPath,
                     ClassLoader parent,
                     PermissionCollection permisions)
              throws MalformedURLException,
                     IOException
Constructor.

Parameters:
classPath - Comma separated path of filenames or URLs pointing to directories or jar files. Directories should end with '/'.
Throws:
IOException
MalformedURLException
Method Detail

setJava2Compliant

public void setJava2Compliant(boolean compliant)
Set Java2 compliant status.

Parameters:
compliant -

isJava2Compliant

public boolean isJava2Compliant()

toString

public String toString()
Overrides:
toString in class Object

getPermissions

public PermissionCollection getPermissions(CodeSource cs)
Overrides:
getPermissions in class URLClassLoader

loadClass

public Class loadClass(String name)
                throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException

loadClass

protected Class loadClass(String name,
                          boolean resolve)
                   throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException

getResource

public URL getResource(String name)
Overrides:
getResource in class ClassLoader

isServerPath

public boolean isServerPath(String name)

isSystemPath

public boolean isSystemPath(String name)

destroy

public void destroy()


Copyright © 2012. All Rights Reserved.