org.oddjob.util
Class ClassLoaderSorter

java.lang.Object
  extended by org.oddjob.util.ClassLoaderSorter

public class ClassLoaderSorter
extends Object

A utility class that finds the highest (in the ClassLoader hierarchy) ClassLoader for the given classes.

TODO: The current implementation assumes that all classes are in the same ClassLoader hierarchy but doesn't validate this. It should.

Author:
rob

Constructor Summary
ClassLoaderSorter()
           
 
Method Summary
 ClassLoader getTopLoader(Class<?>[] forClasses)
          Find the highest required ClassLoader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassLoaderSorter

public ClassLoaderSorter()
Method Detail

getTopLoader

public ClassLoader getTopLoader(Class<?>[] forClasses)
Find the highest required ClassLoader.

Parameters:
forClasses - The Classes.
Returns:
The highest ClassLoader, possibly the System ClassLoader, but never null.