eXo Kernel :: Commons Utils 2.4.9-GA

org.exoplatform.commons.utils
Class ClassLoading

java.lang.Object
  extended by org.exoplatform.commons.utils.ClassLoading

public class ClassLoading
extends Object

Version:
$Id: ClassLoading.java 34360 2009-07-22 23:58:59Z tolusha $
Author:
Anatoliy Bazko

Constructor Summary
ClassLoading()
           
 
Method Summary
static Class<?> forName(String type, Class<?> callerClass)
          Loads the class using the ClassLoader corresponding to the caller class first, if class not found we try with Thread's context ClassLoader (TCCL).
static Class<?> forName(String type, Object callerObject)
          Loads the class using the ClassLoader corresponding to the caller object first, if class not found we try with Thread's context ClassLoader (TCCL).
static Class<?> loadClass(String type, Class<?> callerClass)
          Loads the class using the ClassLoader corresponding to the caller class first, if class not found we try with Thread's context ClassLoader (TCCL).
static Class<?> loadClass(String type, Object callerObject)
          Loads the class using the ClassLoader corresponding to the caller object first, if class not found we try with Thread's context ClassLoader (TCCL).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassLoading

public ClassLoading()
Method Detail

forName

public static Class<?> forName(String type,
                               Object callerObject)
                        throws ClassNotFoundException
Loads the class using the ClassLoader corresponding to the caller object first, if class not found we try with Thread's context ClassLoader (TCCL). If the TCCL doesn't exist or the class still cannot be found, we use the System class loader.

Parameters:
type - FQN of class to load
callerObject - the object from which we want to load the class
Returns:
Loaded class
Throws:
ClassNotFoundException

forName

public static Class<?> forName(String type,
                               Class<?> callerClass)
                        throws ClassNotFoundException
Loads the class using the ClassLoader corresponding to the caller class first, if class not found we try with Thread's context ClassLoader (TCCL). If the TCCL doesn't exist or the class still cannot be found, we use the System class loader.

Parameters:
type - FQN of class to load
callerClass - the class from which we want to load the class
Returns:
Loaded class
Throws:
ClassNotFoundException

loadClass

public static Class<?> loadClass(String type,
                                 Object callerObject)
                          throws ClassNotFoundException
Loads the class using the ClassLoader corresponding to the caller object first, if class not found we try with Thread's context ClassLoader (TCCL). If the TCCL doesn't exist or the class still cannot be found, we use the System class loader.

Parameters:
type - FQN of class to load
callerObject - the object from which we want to load the class
Returns:
Loaded class
Throws:
ClassNotFoundException

loadClass

public static Class<?> loadClass(String type,
                                 Class<?> callerClass)
                          throws ClassNotFoundException
Loads the class using the ClassLoader corresponding to the caller class first, if class not found we try with Thread's context ClassLoader (TCCL). If the TCCL doesn't exist or the class still cannot be found, we use the System class loader.

Parameters:
type - FQN of class to load
callerClass - the class from which we want to load the class
Returns:
Loaded class
Throws:
ClassNotFoundException

eXo Kernel :: Commons Utils 2.4.9-GA

Copyright © 2014 eXo Platform SAS. All Rights Reserved.