public class ClassLoaderUtils extends Object
Constructor and Description |
---|
ClassLoaderUtils() |
Modifier and Type | Method and Description |
---|---|
static ClassLoader |
getClassLoader(Class clazz)
Get the loader for the given class.
|
static ClassLoader |
getClassLoader(ClassLoader specifiedLoader,
boolean useContextClassLoader,
Class callingClass)
Return the class loader to be used for instantiating application objects
when required.
|
static ClassLoader |
getClassLoader(ClassLoader specifiedLoader,
Class callingClass)
Return the class loader to be used for instantiating application objects
when a context class loader is not specified.
|
static Class |
loadClass(String className,
Class callingClass)
Loads the given class using the current Thread's context class loader first
otherwise use the class loader which loaded this class.
|
static Class |
loadClass(String className,
ClassLoader specifiedLoader,
boolean useContextLoader,
Class callingClass)
Loads the given class using:
the specified classloader,
the current Thread's context class loader first, if asked
otherwise use the class loader which loaded this class.
|
public static ClassLoader getClassLoader(ClassLoader specifiedLoader, boolean useContextClassLoader, Class callingClass)
useContextClassLoader
is truepublic static ClassLoader getClassLoader(ClassLoader specifiedLoader, Class callingClass)
public static ClassLoader getClassLoader(Class clazz)
clazz
- the class to retrieve the loader forpublic static Class loadClass(String className, Class callingClass) throws ClassNotFoundException
ClassNotFoundException
public static Class loadClass(String className, ClassLoader specifiedLoader, boolean useContextLoader, Class callingClass) throws ClassNotFoundException
ClassNotFoundException
Copyright © 2014 Apache Software Foundation. All rights reserved.