Class ClassLoaderUtil


  • public final class ClassLoaderUtil
    extends java.lang.Object
    Keeps 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.Object createNewInstance​(java.lang.ClassLoader loader, java.lang.String className)
      Creates a new class instance with the given loader.
      static java.lang.Object createNewInstance​(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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createNewInstance

        public static java.lang.Object createNewInstance​(java.lang.ClassLoader loader,
                                                         java.lang.String className)
                                                  throws CacheException
        Creates a new class instance with the given loader. Logs errors along the way.
        Parameters:
        loader - the classloader to load the class
        className - 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 CacheException
        Creates a new class instance and passes args to the constructor call. Logs errors along the way.
        Parameters:
        loader - the classloader to load the class
        className - a fully qualified class name
        argTypes - Types for constructor argument parameters
        args - Values for constructor argument parameters
        Returns:
        the newly created instance
        Throws:
        CacheException - if instance cannot be created due to a missing class or exception