org.apache.cocoon.maven.deployer.servlet
Class ShieldedClassLoaderManager

java.lang.Object
  extended by org.apache.cocoon.maven.deployer.servlet.ShieldedClassLoaderManager

public class ShieldedClassLoaderManager
extends Object

This class creates a singleton instance of the shielded class loader. It can be configured through context paramters:

Version:
$Id: ShieldedClassLoaderManager.html 1351235 2012-06-18 08:41:39Z ilgrosso $

Nested Class Summary
protected static class ShieldedClassLoaderManager.UrlComparator
          Simple comparator for comparing url objects.
 
Field Summary
protected static String SHIELDED_CLASSES
           
static String SHIELDED_CLASSLOADER_DEBUG
           
static String SHIELDED_CLASSLOADER_USE_REPOSITORY
           
protected static String SHIELDED_LIB
           
protected static ClassLoader shieldedClassLoader
           
static String WEB_INF_SHIELDED_CLASSES
           
static String WEB_INF_SHIELDED_LIB
           
 
Constructor Summary
ShieldedClassLoaderManager()
           
 
Method Summary
protected static ClassLoader createClassLoader(ClassLoader parent, javax.servlet.ServletContext servletContext)
          Create the shielded class loader.
static ClassLoader getClassLoader(javax.servlet.ServletContext servletContext)
          Create the class loader.
static void logDebug(javax.servlet.ServletContext servletContext, String message)
          Log a debug message to the log of the servlet context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHIELDED_CLASSLOADER_DEBUG

public static final String SHIELDED_CLASSLOADER_DEBUG
See Also:
Constant Field Values

SHIELDED_CLASSLOADER_USE_REPOSITORY

public static final String SHIELDED_CLASSLOADER_USE_REPOSITORY
See Also:
Constant Field Values

WEB_INF_SHIELDED_LIB

public static final String WEB_INF_SHIELDED_LIB
See Also:
Constant Field Values

WEB_INF_SHIELDED_CLASSES

public static final String WEB_INF_SHIELDED_CLASSES
See Also:
Constant Field Values

SHIELDED_LIB

protected static final String SHIELDED_LIB
See Also:
Constant Field Values

SHIELDED_CLASSES

protected static final String SHIELDED_CLASSES
See Also:
Constant Field Values

shieldedClassLoader

protected static ClassLoader shieldedClassLoader
Constructor Detail

ShieldedClassLoaderManager

public ShieldedClassLoaderManager()
Method Detail

getClassLoader

public static ClassLoader getClassLoader(javax.servlet.ServletContext servletContext)
                                  throws javax.servlet.ServletException
Create the class loader.

Parameters:
servletContext -
Returns:
Throws:
javax.servlet.ServletException

logDebug

public static void logDebug(javax.servlet.ServletContext servletContext,
                            String message)
Log a debug message to the log of the servlet context. This method first checks if the init parameter "shielded-classloader-debug" has the value true before it logs.

Parameters:
servletContext - The servlet context.
message - The message to log.

createClassLoader

protected static ClassLoader createClassLoader(ClassLoader parent,
                                               javax.servlet.ServletContext servletContext)
                                        throws IOException
Create the shielded class loader.

Throws:
IOException


Copyright © 1999-2012 The Apache Software Foundation. All Rights Reserved.