org.apache.env

Class WhichClass


public abstract class WhichClass
extends java.lang.Object

Class finding service. This effectively replaces Class.forName() calls in this package. Similar to code in javax.xml.*.FactoryFinder. Options included for future use; they could specify something like LOCAL_CLASSLOADER_ONLY for servlet environments, etc.
Version:
$Id: WhichClass.java,v 1.1 2001/12/11 17:42:50 curcuru Exp $
Author:
shane_curcuru@us.ibm.com

Method Summary

static Class
findClass(String className, String options)
Worker method to load a class.
protected static ClassLoader
findClassLoader(String options)
Worker method to figure out which ClassLoader to use.

Method Details

findClass

public static Class findClass(String className,
                              String options)
            throws ClassNotFoundException
Worker method to load a class. Factor out loading classes for future use and JDK differences. Similar to javax.xml.*.FactoryFinder
Parameters:
className - name of class to load from an appropriate classLoader
options - currently unused
Returns:
the class asked for

findClassLoader

protected static ClassLoader findClassLoader(String options)
            throws ClassNotFoundException
Worker method to figure out which ClassLoader to use. For JDK 1.2 and later use the context ClassLoader. Similar to javax.xml.*.FactoryFinder
Parameters:
options - currently unused
Returns:
the appropriate ClassLoader

Copyright B) 2001 Apache. All Rights Reserved.