Apache Tomcat 6.0.41

org.apache.catalina.startup
Class ClassLoaderFactory

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

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):

Author:
Craig R. McClanahan

Field Summary
protected static java.lang.Integer IS_DIR
           
protected static java.lang.Integer IS_GLOB
           
protected static java.lang.Integer IS_JAR
           
protected static java.lang.Integer IS_URL
           
 
Constructor Summary
ClassLoaderFactory()
           
 
Method Summary
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.io.File[] unpacked, java.io.File[] packed, java.net.URL[] urls, 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.lang.String[] locations, java.lang.Integer[] types, java.lang.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
 

Field Detail

IS_DIR

protected static final java.lang.Integer IS_DIR

IS_JAR

protected static final java.lang.Integer IS_JAR

IS_GLOB

protected static final java.lang.Integer IS_GLOB

IS_URL

protected static final java.lang.Integer IS_URL
Constructor Detail

ClassLoaderFactory

public ClassLoaderFactory()
Method Detail

createClassLoader

public static java.lang.ClassLoader createClassLoader(java.io.File[] unpacked,
                                                      java.io.File[] packed,
                                                      java.lang.ClassLoader parent)
                                               throws java.lang.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:
java.lang.Exception - if an error occurs constructing the class loader

createClassLoader

public static java.lang.ClassLoader createClassLoader(java.io.File[] unpacked,
                                                      java.io.File[] packed,
                                                      java.net.URL[] urls,
                                                      java.lang.ClassLoader parent)
                                               throws java.lang.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
urls - Array of URLs to remote repositories, designing either JAR resources or uncompressed directories 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:
java.lang.Exception - if an error occurs constructing the class loader

createClassLoader

public static java.lang.ClassLoader createClassLoader(java.lang.String[] locations,
                                                      java.lang.Integer[] types,
                                                      java.lang.ClassLoader parent)
                                               throws java.lang.Exception
Create and return a new class loader, based on the configuration defaults and the specified directory paths:

Parameters:
locations - Array of strings containing class directories, jar files, jar directories or URLS that should be added to the repositories of the class loader. The type is given by the member of param types.
types - Array of types for the members of param locations. Possible values are IS_DIR (class directory), IS_JAR (single jar file), IS_GLOB (directory of jar files) and IS_URL (URL).
parent - Parent class loader for the new class loader, or null for the system class loader.
Throws:
java.lang.Exception - if an error occurs constructing the class loader

Apache Tomcat 6.0.41

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