Package net.bytebuddy.asm
Class Advice.Delegator.ForDynamicInvocation.Factory
- java.lang.Object
-
- net.bytebuddy.asm.Advice.Delegator.ForDynamicInvocation.Factory
-
- All Implemented Interfaces:
Advice.Delegator.Factory
- Enclosing class:
- Advice.Delegator.ForDynamicInvocation
@Enhance protected static class Advice.Delegator.ForDynamicInvocation.Factory extends java.lang.Object implements Advice.Delegator.Factory
A factory for creating a dynamic invocation dispatcher.
-
-
Field Summary
Fields Modifier and Type Field Description private MethodDescription.InDefinedShape
bootstrapMethod
The bootstrap method.private Advice.BootstrapArgumentResolver.Factory
resolverFactory
A resolver factory to provide the arguments to the bootstrap method.private TypeDescription.Generic.Visitor<? extends TypeDescription.Generic>
visitor
A visitor to apply to the parameter types prior to resolving theMethodType
that is passed to the bootstrap method.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Factory(MethodDescription.InDefinedShape bootstrapMethod, Advice.BootstrapArgumentResolver.Factory resolverFactory, TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
Creates a factory for a dynamic invocation dispatcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Advice.Delegator
make(MethodDescription.InDefinedShape adviceMethod, boolean exit)
Resolves a delegator.
-
-
-
Field Detail
-
bootstrapMethod
private final MethodDescription.InDefinedShape bootstrapMethod
The bootstrap method.
-
resolverFactory
private final Advice.BootstrapArgumentResolver.Factory resolverFactory
A resolver factory to provide the arguments to the bootstrap method.
-
visitor
private final TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor
A visitor to apply to the parameter types prior to resolving theMethodType
that is passed to the bootstrap method. The supplied types might not be available to the instrumented type what might make it necessary to camouflage them to avoid class loading errors. The actual type should then rather be passed in a different format by the suppliedAdvice.BootstrapArgumentResolver
.
-
-
Constructor Detail
-
Factory
protected Factory(MethodDescription.InDefinedShape bootstrapMethod, Advice.BootstrapArgumentResolver.Factory resolverFactory, TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
Creates a factory for a dynamic invocation dispatcher.- Parameters:
bootstrapMethod
- The bootstrap method.resolverFactory
- A resolver factory to provide the arguments to the bootstrap method.visitor
- A visitor to apply to the parameter types prior to resolving theMethodType
that is passed to the bootstrap method. The supplied types might not be available to the instrumented type what might make it necessary to camouflage them to avoid class loading errors. The actual type should then rather be passed in a different format by the suppliedAdvice.BootstrapArgumentResolver
.
-
-
Method Detail
-
make
public Advice.Delegator make(MethodDescription.InDefinedShape adviceMethod, boolean exit)
Resolves a delegator.- Specified by:
make
in interfaceAdvice.Delegator.Factory
- Parameters:
adviceMethod
- The advice method.exit
-true
if the advice is applied as exit advice.- Returns:
- An appropriate delegator.
-
-