Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.opensymphony.oscache.util
Class ClassLoaderUtil

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

public class ClassLoaderUtil
extends java.lang.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 java.lang.Class` | `loadClass(java.lang.String className, java.lang.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 java.lang.Class loadClass(java.lang.String className,
                                            java.lang.Class callingClass)
                                     throws java.lang.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` - The name of the class to load
    `callingClass` - The Class object of the calling object
  Throws:
    `java.lang.ClassNotFoundException` - If the class cannot be found anywhere.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| See www.opensymphony.com for more information.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD