org.apache.openejb.core
Class TempClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by org.apache.openejb.core.TempClassLoader

public class TempClassLoader
extends URLClassLoader

ClassLoader implementation that allows classes to be temporarily loaded and then thrown away. Useful for verifying and inspecting a class without first loading(and thus polluting) the parent ClassLoader.

This class is a proper subclass of URLClassLoader. This class will locally load any class except for those defined in the java.*, javax.* and sun.* packages and annotations all of which are loaded by with Class.forName(name, resolve, getClass().getClassLoader())

Author:
Marc Prud'hommeaux

Nested Class Summary
static class TempClassLoader.IsAnnotationVisitor
           
static class TempClassLoader.IsEnumVisitor
           
 
Constructor Summary
TempClassLoader(ClassLoader parent)
           
 
Method Summary
 Class loadClass(String name)
           
protected  Class loadClass(String name, boolean resolve)
           
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, 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

TempClassLoader

public TempClassLoader(ClassLoader parent)
Method Detail

loadClass

public Class loadClass(String name)
                throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException

loadClass

protected Class loadClass(String name,
                          boolean resolve)
                   throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException


Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.