net.sf.ehcache.util

Class ClassLoaderUtil

public final class ClassLoaderUtil extends Object

Keeps all classloading in ehcache consistent.

Version: $Id: ClassLoaderUtil.java 52 2006-04-24 14:50:03Z gregluck $

Author: Greg Luck

Method Summary
static ObjectcreateNewInstance(String className)
Creates a new class instance.
static ClassLoadergetStandardClassLoader()
Gets the ClassLoader that all classes in ehcache, and extensions, should use for classloading.

Method Detail

createNewInstance

public static Object createNewInstance(String className)
Creates a new class instance. Logs errors along the way. Classes are loaded using the ehcache standard classloader.

Parameters: className a fully qualified class name

Returns: null if the instance cannot be loaded

getStandardClassLoader

public static ClassLoader getStandardClassLoader()
Gets the 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.

Returns: the thread context class loader.