patterntesting.runtime.experimental
Class XrayClassLoader

Package class diagram package XrayClassLoader
java.lang.Object
  extended by java.lang.ClassLoader
      extended by patterntesting.runtime.experimental.XrayClassLoader

public final class XrayClassLoader
extends ClassLoader

If we want to load a class and see what happens if another class (needed by the original class) is missing we need a class loader where we can control the classpath and other things.

Since:
1.1 (26.12.2010)
Author:
oliver

Constructor Summary
XrayClassLoader()
           
 
Method Summary
protected  Class<?> findClass(String classname)
          Find class.
 Set<Class<?>> getLoadedClasses()
          Gets the loaded classed of this classloader here.
 Class<?> loadClass(String classname)
          Load class.
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XrayClassLoader

public XrayClassLoader()
Method Detail

loadClass

public Class<?> loadClass(String classname)
                   throws ClassNotFoundException
Load class.

Overrides:
loadClass in class ClassLoader
Parameters:
classname - the classname
Returns:
the class
Throws:
ClassNotFoundException - the class not found exception
See Also:
ClassLoader.loadClass(java.lang.String)

getLoadedClasses

public Set<Class<?>> getLoadedClasses()
Gets the loaded classed of this classloader here.

Returns:
the loaded classed

findClass

protected Class<?> findClass(String classname)
                      throws ClassNotFoundException
Find class.

Overrides:
findClass in class ClassLoader
Parameters:
classname - the classname
Returns:
the class
Throws:
ClassNotFoundException - the class not found exception
See Also:
ClassLoader.findClass(java.lang.String)


Copyright © 2002–2014 PatternTesting Team. All rights reserved.