Class WebSphereLoadTimeWeaver
- java.lang.Object
- org.springframework.instrument.classloading.websphere.WebSphereLoadTimeWeaver
- All Implemented Interfaces:
LoadTimeWeaver
public class WebSphereLoadTimeWeaver extends Object implements LoadTimeWeaver
LoadTimeWeaver
implementation for WebSphere's instrumentable ClassLoader. Compatible with WebSphere 7 as well as 8 and 9.- Since:
- 3.1
- Author:
- Costin Leau
Constructor Summary
Constructors Constructor Description WebSphereLoadTimeWeaver()
Create a new instance of theWebSphereLoadTimeWeaver
class using the defaultclass loader
.WebSphereLoadTimeWeaver(ClassLoader classLoader)
Create a new instance of theWebSphereLoadTimeWeaver
class using the suppliedClassLoader
.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTransformer(ClassFileTransformer transformer)
Add aClassFileTransformer
to be applied by thisLoadTimeWeaver
.ClassLoader
getInstrumentableClassLoader()
Return aClassLoader
that supports instrumentation through AspectJ-style load-time weaving based on user-definedClassFileTransformers
.ClassLoader
getThrowawayClassLoader()
Return a throwawayClassLoader
, enabling classes to be loaded and inspected without affecting the parentClassLoader
.
Constructor Detail
WebSphereLoadTimeWeaver
public WebSphereLoadTimeWeaver()
Create a new instance of theWebSphereLoadTimeWeaver
class using the defaultclass loader
.- See Also:
ClassUtils.getDefaultClassLoader()
WebSphereLoadTimeWeaver
public WebSphereLoadTimeWeaver(ClassLoader classLoader)
Create a new instance of theWebSphereLoadTimeWeaver
class using the suppliedClassLoader
.- Parameters:
classLoader
- theClassLoader
to delegate to for weaving
Method Detail
addTransformer
public void addTransformer(ClassFileTransformer transformer)
Description copied from interface:LoadTimeWeaver
Add aClassFileTransformer
to be applied by thisLoadTimeWeaver
.- Specified by:
addTransformer
in interfaceLoadTimeWeaver
- Parameters:
transformer
- theClassFileTransformer
to add
getInstrumentableClassLoader
public ClassLoader getInstrumentableClassLoader()
Description copied from interface:LoadTimeWeaver
Return aClassLoader
that supports instrumentation through AspectJ-style load-time weaving based on user-definedClassFileTransformers
.May be the current
ClassLoader
, or aClassLoader
created by thisLoadTimeWeaver
instance.- Specified by:
getInstrumentableClassLoader
in interfaceLoadTimeWeaver
- Returns:
- the
ClassLoader
which will expose instrumented classes according to the registered transformers
getThrowawayClassLoader
public ClassLoader getThrowawayClassLoader()
Description copied from interface:LoadTimeWeaver
Return a throwawayClassLoader
, enabling classes to be loaded and inspected without affecting the parentClassLoader
.Should not return the same instance of the
ClassLoader
returned from an invocation ofLoadTimeWeaver.getInstrumentableClassLoader()
.- Specified by:
getThrowawayClassLoader
in interfaceLoadTimeWeaver
- Returns:
- a temporary throwaway
ClassLoader
; should return a new instance for each call, with no existing state