org.mortbay.http

Class 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.36 2005/11/19 09:04:53 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()

Constructor Details

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

Method Details

destroy

public void destroy()

getPermissions

public PermissionCollection getPermissions(CodeSource cs)

getResource

public URL getResource(String name)

isJava2Compliant

public boolean isJava2Compliant()

isServerPath

public boolean isServerPath(String name)

isSystemPath

public boolean isSystemPath(String name)

loadClass

public Class loadClass(String name)
            throws ClassNotFoundException

loadClass

protected Class loadClass(String name,
                          boolean resolve)
            throws ClassNotFoundException

setJava2Compliant

public void setJava2Compliant(boolean compliant)
Set Java2 compliant status.
Parameters:
compliant -

toString

public String toString()

Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.