Apache Tomcat 7.0.28

org.apache.catalina.startup
Class ClassLoaderFactory

java.lang.Object
  extended by org.apache.catalina.startup.ClassLoaderFactory

public final class ClassLoaderFactory
extends Object

Utility class for building class loaders for Catalina. The factory method requires the following parameters in order to build a new class loader (with suitable defaults in all cases):

Version:
$Id: ClassLoaderFactory.java 1076059 2011-03-01 23:59:36Z kkolinko $
Author:
Craig R. McClanahan

Nested Class Summary
static class ClassLoaderFactory.Repository
           
static class ClassLoaderFactory.RepositoryType
           
 
Constructor Summary
ClassLoaderFactory()
           
 
Method Summary
static ClassLoader createClassLoader(File[] unpacked, File[] packed, ClassLoader parent)
          Create and return a new class loader, based on the configuration defaults and the specified directory paths:
static ClassLoader createClassLoader(List<ClassLoaderFactory.Repository> repositories, ClassLoader parent)
          Create and return a new class loader, based on the configuration defaults and the specified directory paths:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassLoaderFactory

public ClassLoaderFactory()
Method Detail

createClassLoader

public static ClassLoader createClassLoader(File[] unpacked,
                                            File[] packed,
                                            ClassLoader parent)
                                     throws Exception
Create and return a new class loader, based on the configuration defaults and the specified directory paths:

Parameters:
unpacked - Array of pathnames to unpacked directories that should be added to the repositories of the class loader, or null for no unpacked directories to be considered
packed - Array of pathnames to directories containing JAR files that should be added to the repositories of the class loader, or null for no directories of JAR files to be considered
parent - Parent class loader for the new class loader, or null for the system class loader.
Throws:
Exception - if an error occurs constructing the class loader

createClassLoader

public static ClassLoader createClassLoader(List<ClassLoaderFactory.Repository> repositories,
                                            ClassLoader parent)
                                     throws Exception
Create and return a new class loader, based on the configuration defaults and the specified directory paths:

Parameters:
repositories - List of class directories, jar files, jar directories or URLS that should be added to the repositories of the class loader.
parent - Parent class loader for the new class loader, or null for the system class loader.
Throws:
Exception - if an error occurs constructing the class loader

Apache Tomcat 7.0.28

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