Package net.bytebuddy.agent.builder
Class AgentBuilder.DescriptionStrategy.SuperTypeLoading
- java.lang.Object
-
- net.bytebuddy.agent.builder.AgentBuilder.DescriptionStrategy.SuperTypeLoading
-
- All Implemented Interfaces:
AgentBuilder.DescriptionStrategy
- Enclosing interface:
- AgentBuilder.DescriptionStrategy
@Enhance public static class AgentBuilder.DescriptionStrategy.SuperTypeLoading extends java.lang.Object implements AgentBuilder.DescriptionStrategy
A description strategy that enforces the loading of any super type of a type description but delegates the actual type description to another description strategy.
Warning: When using this description strategy, a type is not instrumented if any of its subtypes is loaded first. The instrumentation API does not submit such types to a class file transformer on most VM implementations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AgentBuilder.DescriptionStrategy.SuperTypeLoading.Asynchronous
A description strategy that enforces the loading of any super type of a type description but delegates the actual type description to another description strategy.protected static class
AgentBuilder.DescriptionStrategy.SuperTypeLoading.UnlockingClassLoadingDelegate
A class loading delegate that unlocks the circularity lock during class loading.-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.DescriptionStrategy
AgentBuilder.DescriptionStrategy.Default, AgentBuilder.DescriptionStrategy.SuperTypeLoading
-
-
Field Summary
Fields Modifier and Type Field Description private AgentBuilder.DescriptionStrategy
delegate
The delegate description strategy.
-
Constructor Summary
Constructors Constructor Description SuperTypeLoading(AgentBuilder.DescriptionStrategy delegate)
Creates a new description strategy that enforces loading of a super type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeDescription
apply(java.lang.String name, java.lang.Class<?> type, TypePool typePool, AgentBuilder.CircularityLock circularityLock, java.lang.ClassLoader classLoader, JavaModule module)
Describes the given type.boolean
isLoadedFirst()
Indicates if this description strategy makes use of loaded type information and yields a different type description if no loaded type is available.
-
-
-
Field Detail
-
delegate
private final AgentBuilder.DescriptionStrategy delegate
The delegate description strategy.
-
-
Constructor Detail
-
SuperTypeLoading
public SuperTypeLoading(AgentBuilder.DescriptionStrategy delegate)
Creates a new description strategy that enforces loading of a super type.- Parameters:
delegate
- The delegate description strategy.
-
-
Method Detail
-
isLoadedFirst
public boolean isLoadedFirst()
Indicates if this description strategy makes use of loaded type information and yields a different type description if no loaded type is available.- Specified by:
isLoadedFirst
in interfaceAgentBuilder.DescriptionStrategy
- Returns:
true
if this description strategy prefers loaded type information when describing a type and only uses a type pool if loaded type information is not available.
-
apply
public TypeDescription apply(java.lang.String name, java.lang.Class<?> type, TypePool typePool, AgentBuilder.CircularityLock circularityLock, java.lang.ClassLoader classLoader, JavaModule module)
Describes the given type.- Specified by:
apply
in interfaceAgentBuilder.DescriptionStrategy
- Parameters:
name
- The binary name of the type to describe.type
- The type that is being redefined, if a redefinition is applied ornull
if no redefined type is available.typePool
- The type pool to use for locating a type if required.circularityLock
- The currently used circularity lock.classLoader
- The type's class loader wherenull
represents the bootstrap class loader.module
- The type's module ornull
if the current VM does not support modules.- Returns:
- An appropriate type description.
-
-