The Spring Framework

org.springframework.instrument.classloading
Class ShadowingClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by org.springframework.instrument.classloading.ShadowingClassLoader
Direct Known Subclasses:
ResourceOverridingShadowingClassLoader

public class ShadowingClassLoader
extends ClassLoader

Since:
2.0
Author:
Rob Harrop, Rod Johnson, Costin Leau

Constructor Summary
ShadowingClassLoader(ClassLoader enclosingClassLoader)
           
 
Method Summary
 void addTransformer(ClassFileTransformer transformer)
           
 void addTransformers(ShadowingClassLoader other)
           
 URL getResource(String name)
           
 InputStream getResourceAsStream(String name)
           
 Enumeration<URL> getResources(String name)
           
protected  boolean isClassNameExcludedFromShadowing(String className)
          Subclasses can override this method to specify whether or not particular classes are excluded from shadowing
 Class<?> loadClass(String name)
           
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, 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

ShadowingClassLoader

public ShadowingClassLoader(ClassLoader enclosingClassLoader)
Method Detail

loadClass

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

isClassNameExcludedFromShadowing

protected boolean isClassNameExcludedFromShadowing(String className)
Subclasses can override this method to specify whether or not particular classes are excluded from shadowing

Parameters:
className - class name to test

addTransformers

public void addTransformers(ShadowingClassLoader other)

addTransformer

public void addTransformer(ClassFileTransformer transformer)

getResource

public URL getResource(String name)
Overrides:
getResource in class ClassLoader

getResourceAsStream

public InputStream getResourceAsStream(String name)
Overrides:
getResourceAsStream in class ClassLoader

getResources

public Enumeration<URL> getResources(String name)
                              throws IOException
Overrides:
getResources in class ClassLoader
Throws:
IOException

The Spring Framework

Copyright © 2002-2006 The Spring Framework.