org.springframework.context.support
Class ContextTypeMatchClassLoader.ContextOverridingClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by org.springframework.core.DecoratingClassLoader
          extended by org.springframework.core.OverridingClassLoader
              extended by org.springframework.context.support.ContextTypeMatchClassLoader.ContextOverridingClassLoader
Enclosing class:
ContextTypeMatchClassLoader

private class ContextTypeMatchClassLoader.ContextOverridingClassLoader
extends OverridingClassLoader

ClassLoader to be created for each loaded class. Caches class file content but redefines class for each call.


Field Summary
 
Fields inherited from class org.springframework.core.OverridingClassLoader
DEFAULT_EXCLUDED_PACKAGES
 
Constructor Summary
ContextTypeMatchClassLoader.ContextOverridingClassLoader(java.lang.ClassLoader parent)
           
 
Method Summary
protected  boolean isEligibleForOverriding(java.lang.String className)
          Determine whether the specified class is eligible for overriding by this class loader.
protected  java.lang.Class loadClassForOverriding(java.lang.String name)
          Load the specified class for overriding purposes in this ClassLoader.
 
Methods inherited from class org.springframework.core.OverridingClassLoader
loadBytesForClass, loadClass, openStreamForClass, transformIfNecessary
 
Methods inherited from class org.springframework.core.DecoratingClassLoader
excludeClass, excludePackage, isExcluded
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, 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

ContextTypeMatchClassLoader.ContextOverridingClassLoader

public ContextTypeMatchClassLoader.ContextOverridingClassLoader(java.lang.ClassLoader parent)
Method Detail

isEligibleForOverriding

protected boolean isEligibleForOverriding(java.lang.String className)
Description copied from class: OverridingClassLoader
Determine whether the specified class is eligible for overriding by this class loader.

Overrides:
isEligibleForOverriding in class OverridingClassLoader
Parameters:
className - the class name to check
Returns:
whether the specified class is eligible
See Also:
DecoratingClassLoader.isExcluded(java.lang.String)

loadClassForOverriding

protected java.lang.Class loadClassForOverriding(java.lang.String name)
                                          throws java.lang.ClassNotFoundException
Description copied from class: OverridingClassLoader
Load the specified class for overriding purposes in this ClassLoader.

The default implementation delegates to ClassLoader.findLoadedClass(java.lang.String), OverridingClassLoader.loadBytesForClass(java.lang.String) and ClassLoader.defineClass(byte[], int, int).

Overrides:
loadClassForOverriding in class OverridingClassLoader
Parameters:
name - the name of the class
Returns:
the Class object, or null if no class defined for that name
Throws:
java.lang.ClassNotFoundException - if the class for the given name couldn't be loaded