Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.security.utils

pack-priv final Class ClassLoaderUtils

extends Object
Class Inheritance

This class is extremely useful for loading classes in a fault tolerant manner that works across different applications servers. Do not touch this unless you're a grizzled classloading guru veteran who is going to verify any change on 6 different application servers. This class and methods in this class are package private. The class is duplicated to multiple packages.

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static Class<?>
loadClass(String
The name of the class to load
className
,
Class<?>
The Class object of the calling object
callingClass
)

Load a class with a given name.

private static Class<?>
loadClass2(String className, Class<?> callingClass)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final Logger LOG

Constructor Detail

ClassLoaderUtilsback to summary
private ClassLoaderUtils()

Method Detail

loadClassback to summary
pack-priv static Class<?> loadClass(String className, Class<?> callingClass) throws ClassNotFoundException

Load a class with a given name.

It will try to load the class in the following order:
  • From Thread.currentThread().getContextClassLoader()
  • Using the basic Class.forName()
  • From ClassLoaderUtil.class.getClassLoader()
  • From the callingClass.getClassLoader()
Parameters
className:String

The name of the class to load

callingClass:Class<?>

The Class object of the calling object

Exceptions
ClassNotFoundException:
If the class cannot be found anywhere.
loadClass2back to summary
private static Class<?> loadClass2(String className, Class<?> callingClass) throws ClassNotFoundException