org.jboss.axis.utils
Class ClassUtils

java.lang.Object
  extended byorg.jboss.axis.utils.ClassUtils

public final class ClassUtils
extends java.lang.Object

Utility methods for Class Loading.


Constructor Summary
ClassUtils()
           
 
Method Summary
static java.lang.Class forName(java.lang.String className)
          Use this method instead of Class.forName
static java.lang.Class forName(java.lang.String _className, boolean init, java.lang.ClassLoader _loader)
          Use this method instead of Class.forName (String className, boolean init, ClassLoader loader)
static java.lang.ClassLoader getClassLoader(java.lang.String className)
          Obtain the ClassLoader (if any) associated with the given className.
static java.io.InputStream getResourceAsStream(java.lang.Class clazz, java.lang.String resource)
           
static void removeClassLoader(java.lang.String className)
          Deregister the ClassLoader for a given className.
static void setClassLoader(java.lang.String className, java.lang.ClassLoader loader)
          Set the ClassLoader associated with the given className.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassUtils

public ClassUtils()
Method Detail

setClassLoader

public static void setClassLoader(java.lang.String className,
                                  java.lang.ClassLoader loader)
Set the ClassLoader associated with the given className.

Parameters:
className - the name of a class

getClassLoader

public static java.lang.ClassLoader getClassLoader(java.lang.String className)
Obtain the ClassLoader (if any) associated with the given className.

Parameters:
className - the name of a class
Returns:
class loader

removeClassLoader

public static void removeClassLoader(java.lang.String className)
Deregister the ClassLoader for a given className.

Parameters:
className - the name of a class

forName

public static java.lang.Class forName(java.lang.String className)
                               throws java.lang.ClassNotFoundException
Use this method instead of Class.forName

Parameters:
className - Class name
Returns:
java class
Throws:
java.lang.ClassNotFoundException - if the class is not found

forName

public static java.lang.Class forName(java.lang.String _className,
                                      boolean init,
                                      java.lang.ClassLoader _loader)
                               throws java.lang.ClassNotFoundException
Use this method instead of Class.forName (String className, boolean init, ClassLoader loader)

Throws:
java.lang.ClassNotFoundException

getResourceAsStream

public static java.io.InputStream getResourceAsStream(java.lang.Class clazz,
                                                      java.lang.String resource)