com.opensymphony.oscache.util
Class ClassLoaderUtil

java.lang.Object
  extended by com.opensymphony.oscache.util.ClassLoaderUtil

public class ClassLoaderUtil
extends Object

This code is borrowed directly from OSCore, but is duplicated here to avoid having to add a dependency on the entire OSCore jar.

If much more code from OSCore is needed then it might be wiser to bite the bullet and add a dependency.


Constructor Summary
ClassLoaderUtil()
           
 
Method Summary
static Class loadClass(String className, Class callingClass)
          Load a class with a given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassLoaderUtil

public ClassLoaderUtil()
Method Detail

loadClass

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

Parameters:
className - The name of the class to load
callingClass - The Class object of the calling object
Throws:
ClassNotFoundException - If the class cannot be found anywhere.

OSCache Project Page