public final class ClassLoaderFactory
extends java.lang.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):
ClassLoader
instance that should become the parent of
the new class loader.Modifier and Type | Class and Description |
---|---|
static class |
ClassLoaderFactory.Repository |
static class |
ClassLoaderFactory.RepositoryType |
Constructor and Description |
---|
ClassLoaderFactory() |
Modifier and Type | Method and Description |
---|---|
static java.lang.ClassLoader |
createClassLoader(java.io.File[] unpacked,
java.io.File[] packed,
java.lang.ClassLoader parent)
Create and return a new class loader, based on the configuration
defaults and the specified directory paths:
|
static java.lang.ClassLoader |
createClassLoader(java.util.List<ClassLoaderFactory.Repository> repositories,
java.lang.ClassLoader parent)
Create and return a new class loader, based on the configuration
defaults and the specified directory paths:
|
public static java.lang.ClassLoader createClassLoader(java.io.File[] unpacked, java.io.File[] packed, java.lang.ClassLoader parent) throws java.lang.Exception
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 consideredpacked
- 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 consideredparent
- Parent class loader for the new class loader, or
null
for the system class loader.java.lang.Exception
- if an error occurs constructing the class loaderpublic static java.lang.ClassLoader createClassLoader(java.util.List<ClassLoaderFactory.Repository> repositories, java.lang.ClassLoader parent) throws java.lang.Exception
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.java.lang.Exception
- if an error occurs constructing the class loaderCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.