public final class ClassLoaderUtil
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
ClassLoaderUtil()
Utility class.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
createNewInstance(java.lang.String className)
Creates a new class instance.
|
static java.lang.Object |
createNewInstance(java.lang.String className,
java.lang.Class[] argTypes,
java.lang.Object[] args)
Creates a new class instance and passes args to the constructor call.
|
static java.lang.ClassLoader |
getFallbackClassLoader()
Gets a fallback
ClassLoader that all classes in ehcache, and extensions,
should use for classloading. |
static java.lang.ClassLoader |
getStandardClassLoader()
Gets the
ClassLoader that all classes in ehcache, and extensions, should
use for classloading. |
static java.lang.Class |
loadClass(java.lang.String className)
Load the given class by name
|
public static java.lang.ClassLoader getStandardClassLoader()
ClassLoader
that all classes in ehcache, and extensions, should
use for classloading. All ClassLoading in ehcache should use this one. This is the only
thing that seems to work for all of the class loading situations found in the wild.public static java.lang.ClassLoader getFallbackClassLoader()
ClassLoader
that all classes in ehcache, and extensions,
should use for classloading. This is used if the context class loader does not work.ClassLoaderUtil.class.getClassLoader();
public static java.lang.Object createNewInstance(java.lang.String className) throws CacheException
className
- a fully qualified class nameCacheException
- if instance cannot be created due to a missing class or exceptionpublic static java.lang.Object createNewInstance(java.lang.String className, java.lang.Class[] argTypes, java.lang.Object[] args) throws CacheException
className
- a fully qualified class nameargTypes
- Types for constructor argument parametersargs
- Values for constructor argument parametersCacheException
- if instance cannot be created due to a missing class or exceptionpublic static java.lang.Class loadClass(java.lang.String className) throws java.lang.ClassNotFoundException
className
- a fully qualified class namejava.lang.ClassNotFoundException
- if the class cannot be loaded