Class GlassFishLoadTimeWeaver
java.lang.Object
org.springframework.instrument.classloading.glassfish.GlassFishLoadTimeWeaver
- All Implemented Interfaces:
LoadTimeWeaver
LoadTimeWeaver
implementation for GlassFish's
org.glassfish.api.deployment.InstrumentableClassLoader InstrumentableClassLoader
.
This weaver supports GlassFish 4+.
- Since:
- 2.0.1
- Author:
- Costin Leau, Juergen Hoeller
-
Constructor Summary
ConstructorDescriptionCreate a new instance of theGlassFishLoadTimeWeaver
class using the defaultclass loader
.GlassFishLoadTimeWeaver
(ClassLoader classLoader) Create a new instance of theGlassFishLoadTimeWeaver
class using the suppliedClassLoader
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTransformer
(ClassFileTransformer transformer) Add aClassFileTransformer
to be applied by thisLoadTimeWeaver
.Return aClassLoader
that 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
-
GlassFishLoadTimeWeaver
public GlassFishLoadTimeWeaver()Create a new instance of theGlassFishLoadTimeWeaver
class using the defaultclass loader
.- See Also:
-
GlassFishLoadTimeWeaver
Create a new instance of theGlassFishLoadTimeWeaver
class using the suppliedClassLoader
.- Parameters:
classLoader
- theClassLoader
to delegate to for weaving
-
-
Method Details
-
addTransformer
Description copied from interface:LoadTimeWeaver
Add aClassFileTransformer
to be applied by thisLoadTimeWeaver
.- Specified by:
addTransformer
in interfaceLoadTimeWeaver
- Parameters:
transformer
- theClassFileTransformer
to add
-
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
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
-