org.apache.geronimo.kernel.classloader
Class TemporaryClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by org.apache.geronimo.kernel.classloader.TemporaryClassLoader

public class TemporaryClassLoader
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 TemporaryClassLoader.IsAnnotationVisitor
           
 
Constructor Summary
TemporaryClassLoader(ClassLoader parent)
           
TemporaryClassLoader(URL[] urls)
           
TemporaryClassLoader(URL[] urls, ClassLoader parent)
           
TemporaryClassLoader(URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory)
           
 
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

TemporaryClassLoader

public TemporaryClassLoader(ClassLoader parent)

TemporaryClassLoader

public TemporaryClassLoader(URL[] urls,
                            ClassLoader parent)

TemporaryClassLoader

public TemporaryClassLoader(URL[] urls)

TemporaryClassLoader

public TemporaryClassLoader(URL[] urls,
                            ClassLoader parent,
                            URLStreamHandlerFactory factory)
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 © 2003-2008 The Apache Geronimo development community. All Rights Reserved.