Top Description Constructors Methods
net.sf.ehcache.util

public final Class ClassLoaderUtil

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, .InvocationTargetException, net.sf.ehcache.CacheException

Keeps all classloading in ehcache consistent.
Author
Greg Luck
Version
$Id: ClassLoaderUtil.java 8764 2014-02-18 23:08:43Z teck $

Constructor Summary

AccessConstructor and Description
private
ClassLoaderUtil()

Utility class.

Method Summary

Modifier and TypeMethod and Description
public static Object

Returns:

the newly created instance
createNewInstance
(ClassLoader
the classloader to load the class
loader
,
String
a fully qualified class name
className
)

Creates a new class instance with the given loader.

public static Object

Returns:

the newly created instance
createNewInstance
(ClassLoader
the classloader to load the class
loader
,
String
a fully qualified class name
className
,
Class<T>[]
Types for constructor argument parameters
argTypes
,
Object[]
Values for constructor argument parameters
args
)

Creates a new class instance and passes args to the constructor call.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ClassLoaderUtilback to summary
private ClassLoaderUtil()

Utility class.

Method Detail

createNewInstanceback to summary
public static Object createNewInstance(ClassLoader loader, String className) throws CacheException

Creates a new class instance with the given loader. Logs errors along the way.

Parameters
loader:ClassLoader

the classloader to load the class

className:String

a fully qualified class name

Returns:Object

the newly created instance

Exceptions
CacheException:
if instance cannot be created due to a missing class or exception
createNewInstanceback to summary
public static Object createNewInstance(ClassLoader loader, String className, Class<T>[] argTypes, Object[] args) throws CacheException

Creates a new class instance and passes args to the constructor call. Logs errors along the way.

Parameters
loader:ClassLoader

the classloader to load the class

className:String

a fully qualified class name

argTypes:Class<T>[]

Types for constructor argument parameters

args:Object[]

Values for constructor argument parameters

Returns:Object

the newly created instance

Exceptions
CacheException:
if instance cannot be created due to a missing class or exception