Package org.apache.catalina.startup
Class ClassLoaderFactory
java.lang.Object
org.apache.catalina.startup.ClassLoaderFactory
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):
- A set of directories containing unpacked classes (and resources) that should be included in the class loader's repositories.
- A set of directories containing classes and resources in JAR files. Each readable JAR file discovered in these directories will be added to the class loader's repositories.
- ClassLoaderinstance that should become the parent of the new class loader.
- Author:
- Craig R. McClanahan
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classstatic enum
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic ClassLoadercreateClassLoader(File[] unpacked, File[] packed, ClassLoader parent) Create and return a new class loader, based on the configuration defaults and the specified directory paths:static ClassLoadercreateClassLoader(List<ClassLoaderFactory.Repository> repositories, ClassLoader parent) Create and return a new class loader, based on the configuration defaults and the specified directory paths:
- 
Constructor Details- 
ClassLoaderFactorypublic ClassLoaderFactory()
 
- 
- 
Method Details- 
createClassLoaderpublic 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- nullfor 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- nullfor no directories of JAR files to be considered
- parent- Parent class loader for the new class loader, or- nullfor the system class loader.
- Returns:
- the new class loader
- Throws:
- Exception- if an error occurs constructing the class loader
 
- 
createClassLoaderpublic 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- nullfor the system class loader.
- Returns:
- the new class loader
- Throws:
- Exception- if an error occurs constructing the class loader
 
 
-