public interface InstrumentableClassLoader
ClassFileTransformer
s. These transformers can instrument
(or weave) the byte code of classes loaded through this class loader
to alter their behavior. Currently only
WebappClassLoaderBase
implements this
interface. This allows web application frameworks or JPA providers
bundled with a web application to instrument web application classes
as necessary.
You should always program against the methods of this interface
(whether using reflection or otherwise). The methods in
WebappClassLoaderBase
are protected by the default security
manager if one is in use.
Modifier and Type | Method and Description |
---|---|
void |
addTransformer(java.lang.instrument.ClassFileTransformer transformer)
Adds the specified class file transformer to this class loader.
|
java.lang.ClassLoader |
copyWithoutTransformers()
Returns a copy of this class loader without any class file
transformers.
|
void |
removeTransformer(java.lang.instrument.ClassFileTransformer transformer)
Removes the specified class file transformer from this class loader.
|
void addTransformer(java.lang.instrument.ClassFileTransformer transformer)
transformer
- The transformer to add to the class loaderjava.lang.IllegalArgumentException
- if the transformer is null.void removeTransformer(java.lang.instrument.ClassFileTransformer transformer)
transformer
- The transformer to removejava.lang.ClassLoader copyWithoutTransformers()
ClassFileTransformer
's
transform
method.
The returned class loader's resource cache will have been cleared so that classes already instrumented will not be retained or returned.
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.