Package org.apache.catalina.startup
Class ClassLoaderFactory
- java.lang.Object
-
- 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):
- 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.
ClassLoader
instance that should become the parent of the new class loader.
- Version:
- $Revision: 1.3 $ $Date: 2006/03/12 01:27:06 $
- Author:
- Craig R. McClanahan
-
-
Constructor Summary
Constructors Constructor Description ClassLoaderFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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(File[] unpacked, File[] packed, URL[] urls, ClassLoader parent)
Create and return a new class loader, based on the configuration defaults and the specified directory paths:static int
getDebug()
Return the debugging detail level.static void
setDebug(int newDebug)
Set the debugging detail level.
-
-
-
Method Detail
-
getDebug
public static int getDebug()
Return the debugging detail level.
-
setDebug
public static void setDebug(int newDebug)
Set the debugging detail level.- Parameters:
newDebug
- The new debugging detail level
-
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, ornull
for no unpacked directories to be consideredpacked
- Array of pathnames to directories containing JAR files that should be added to the repositories of the class loader, ornull
for no directories of JAR files to be consideredparent
- Parent class loader for the new class loader, ornull
for the system class loader.- Throws:
Exception
- if an error occurs constructing the class loader
-
createClassLoader
public static ClassLoader createClassLoader(File[] unpacked, File[] packed, URL[] urls, 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, ornull
for no unpacked directories to be consideredpacked
- Array of pathnames to directories containing JAR files that should be added to the repositories of the class loader, ornull
for no directories of JAR files to be consideredurls
- Array of URLs to remote repositories, designing either JAR resources or uncompressed directories that should be added to the repositories of the class loader, ornull
for no directories of JAR files to be consideredparent
- Parent class loader for the new class loader, ornull
for the system class loader.- Throws:
Exception
- if an error occurs constructing the class loader
-
-