Class TomcatLoadTimeWeaver
java.lang.Object
org.springframework.instrument.classloading.tomcat.TomcatLoadTimeWeaver
- All Implemented Interfaces:
- LoadTimeWeaver
LoadTimeWeaver implementation
 for Tomcat's new org.apache.tomcat.InstrumentableClassLoader.
 Also capable of handling Spring's TomcatInstrumentableClassLoader when encountered.- Since:
- 4.0
- Author:
- Juergen Hoeller
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a new instance of theTomcatLoadTimeWeaverclass using the defaultclass loader.TomcatLoadTimeWeaver(ClassLoader classLoader) Create a new instance of theTomcatLoadTimeWeaverclass using the suppliedClassLoader.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddTransformer(ClassFileTransformer transformer) Add aClassFileTransformerto be applied by thisLoadTimeWeaver.Return aClassLoaderthat supports instrumentation through AspectJ-style load-time weaving based on user-definedClassFileTransformers.Return a throwawayClassLoader, enabling classes to be loaded and inspected without affecting the parentClassLoader.
- 
Constructor Details- 
TomcatLoadTimeWeaverpublic TomcatLoadTimeWeaver()Create a new instance of theTomcatLoadTimeWeaverclass using the defaultclass loader.- See Also:
 
- 
TomcatLoadTimeWeaverCreate a new instance of theTomcatLoadTimeWeaverclass using the suppliedClassLoader.- Parameters:
- classLoader- the- ClassLoaderto delegate to for weaving
 
 
- 
- 
Method Details- 
addTransformerDescription copied from interface:LoadTimeWeaverAdd aClassFileTransformerto be applied by thisLoadTimeWeaver.- Specified by:
- addTransformerin interface- LoadTimeWeaver
- Parameters:
- transformer- the- ClassFileTransformerto add
 
- 
getInstrumentableClassLoaderDescription copied from interface:LoadTimeWeaverReturn aClassLoaderthat supports instrumentation through AspectJ-style load-time weaving based on user-definedClassFileTransformers.May be the current ClassLoader, or aClassLoadercreated by thisLoadTimeWeaverinstance.- Specified by:
- getInstrumentableClassLoaderin interface- LoadTimeWeaver
- Returns:
- the ClassLoaderwhich will expose instrumented classes according to the registered transformers
 
- 
getThrowawayClassLoaderDescription copied from interface:LoadTimeWeaverReturn a throwawayClassLoader, enabling classes to be loaded and inspected without affecting the parentClassLoader.Should not return the same instance of the ClassLoaderreturned from an invocation ofLoadTimeWeaver.getInstrumentableClassLoader().- Specified by:
- getThrowawayClassLoaderin interface- LoadTimeWeaver
- Returns:
- a temporary throwaway ClassLoader; should return a new instance for each call, with no existing state
 
 
-