Package net.sf.ehcache.util
Class ClassLoaderUtil
- java.lang.Object
-
- net.sf.ehcache.util.ClassLoaderUtil
-
public final class ClassLoaderUtil extends java.lang.ObjectKeeps all classloading in ehcache consistent.- Version:
- $Id$
- Author:
- Greg Luck
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.ObjectcreateNewInstance(java.lang.ClassLoader loader, java.lang.String className)Creates a new class instance with the given loader.static java.lang.ObjectcreateNewInstance(java.lang.ClassLoader loader, java.lang.String className, java.lang.Class[] argTypes, java.lang.Object[] args)Creates a new class instance and passes args to the constructor call.
-
-
-
Method Detail
-
createNewInstance
public static java.lang.Object createNewInstance(java.lang.ClassLoader loader, java.lang.String className) throws CacheExceptionCreates a new class instance with the given loader. Logs errors along the way.- Parameters:
loader- the classloader to load the classclassName- a fully qualified class name- Returns:
- the newly created instance
- Throws:
CacheException- if instance cannot be created due to a missing class or exception
-
createNewInstance
public static java.lang.Object createNewInstance(java.lang.ClassLoader loader, java.lang.String className, java.lang.Class[] argTypes, java.lang.Object[] args) throws CacheExceptionCreates a new class instance and passes args to the constructor call. Logs errors along the way.- Parameters:
loader- the classloader to load the classclassName- a fully qualified class nameargTypes- Types for constructor argument parametersargs- Values for constructor argument parameters- Returns:
- the newly created instance
- Throws:
CacheException- if instance cannot be created due to a missing class or exception
-
-