jfun.util
Class ClassLoaderUtils

java.lang.Object
  extended by jfun.util.ClassLoaderUtils

public class ClassLoaderUtils
extends java.lang.Object

Utility functions for ClassLoader related function.

Author:
Ben Yu Jan 16, 2006 6:29:28 PM

Constructor Summary
ClassLoaderUtils()
           
 
Method Summary
static java.lang.ClassLoader guessClassLoader(java.lang.ClassLoader candidate)
          Guess the most appropriate ClassLoader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassLoaderUtils

public ClassLoaderUtils()
Method Detail

guessClassLoader

public static java.lang.ClassLoader guessClassLoader(java.lang.ClassLoader candidate)
Guess the most appropriate ClassLoader.

This implementation chooses either the candidate ClassLoader, or the current context ClassLoader, or the system ClassLoader, whichever is the child ClassLoader of the other two.

If case no parent-child relationship is present, context ClassLoader takes precedence, then the candidate class loader, then the system class loader.

Parameters:
candidate - the candidate ClassLoader.
Returns:
the most appropriate ClassLoader.