public class

ShadowingClassLoader

extends DecoratingClassLoader
java.lang.Object
   ↳ java.lang.ClassLoader
     ↳ org.springframework.core.DecoratingClassLoader
       ↳ org.springframework.instrument.classloading.ShadowingClassLoader
Known Direct Subclasses

Class Overview

ClassLoader decorator that shadows an enclosing ClassLoader, applying registered transformers to all affected classes.

Summary

Fields
public static final String[] DEFAULT_EXCLUDED_PACKAGES Packages that are excluded by default
Public Constructors
ShadowingClassLoader(ClassLoader enclosingClassLoader)
Create a new ShadowingClassLoader, decorating the given ClassLoader.
Public Methods
void addTransformer(ClassFileTransformer transformer)
Add the given ClassFileTransformer to the list of transformers that this ClassLoader will apply.
void copyTransformers(ShadowingClassLoader other)
Copy all ClassFileTransformers from the given ClassLoader to the list of transformers that this ClassLoader will apply.
URL getResource(String name)
InputStream getResourceAsStream(String name)
Enumeration<URL> getResources(String name)
Class<?> loadClass(String name)
Protected Methods
boolean isEligibleForShadowing(String className)
Determine whether the specified class is eligible for shadowing by this class loader.
[Expand]
Inherited Methods
From class org.springframework.core.DecoratingClassLoader
From class java.lang.ClassLoader
From class java.lang.Object

Fields

public static final String[] DEFAULT_EXCLUDED_PACKAGES

Packages that are excluded by default

Public Constructors

public ShadowingClassLoader (ClassLoader enclosingClassLoader)

Create a new ShadowingClassLoader, decorating the given ClassLoader.

Parameters
enclosingClassLoader the ClassLoader to decorate

Public Methods

public void addTransformer (ClassFileTransformer transformer)

Add the given ClassFileTransformer to the list of transformers that this ClassLoader will apply.

Parameters
transformer the ClassFileTransformer

public void copyTransformers (ShadowingClassLoader other)

Copy all ClassFileTransformers from the given ClassLoader to the list of transformers that this ClassLoader will apply.

Parameters
other the ClassLoader to copy from

public URL getResource (String name)

public InputStream getResourceAsStream (String name)

public Enumeration<URL> getResources (String name)

Throws
IOException

public Class<?> loadClass (String name)

Protected Methods

protected boolean isEligibleForShadowing (String className)

Determine whether the specified class is eligible for shadowing by this class loader.

Parameters
className the class name to check
Returns
  • whether the specified class is eligible