Package net.bytebuddy.asm
Class Advice.Dispatcher.Delegating
java.lang.Object
net.bytebuddy.asm.Advice.Dispatcher.Delegating
- All Implemented Interfaces:
Advice.Dispatcher,Advice.Dispatcher.Unresolved
- Enclosing interface:
Advice.Dispatcher
@Enhance
public static class Advice.Dispatcher.Delegating
extends Object
implements Advice.Dispatcher.Unresolved
A dispatcher for an advice method that is being invoked from the instrumented method.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA resolved version of a dispatcher.Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.Dispatcher
Advice.Dispatcher.Bound, Advice.Dispatcher.Delegating, Advice.Dispatcher.Inactive, Advice.Dispatcher.Inlining, Advice.Dispatcher.RelocationHandler, Advice.Dispatcher.SuppressionHandler, Advice.Dispatcher.Unresolved -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MethodDescription.InDefinedShapeThe advice method.protected final Advice.Delegator.FactoryThe delegator factory to use.Fields inherited from interface net.bytebuddy.asm.Advice.Dispatcher
IGNORE_ANNOTATION, IGNORE_METHOD -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDelegating(MethodDescription.InDefinedShape adviceMethod, Advice.Delegator.Factory delegatorFactory) Creates a new delegating advice dispatcher. -
Method Summary
Modifier and TypeMethodDescriptionasMethodEnter(List<? extends Advice.OffsetMapping.Factory<?>> userFactories, org.objectweb.asm.ClassReader classReader, Advice.Dispatcher.Unresolved methodExit, Advice.PostProcessor.Factory postProcessorFactory) Resolves this dispatcher as a dispatcher for entering a method.asMethodExit(List<? extends Advice.OffsetMapping.Factory<?>> userFactories, org.objectweb.asm.ClassReader classReader, Advice.Dispatcher.Unresolved methodEnter, Advice.PostProcessor.Factory postProcessorFactory) Resolves this dispatcher as a dispatcher for exiting a method.The type that is produced as a result of executing this advice method.Returns the named types declared by this enter advice.booleanisAlive()Returnstrueif this dispatcher is alive.booleanisBinary()Indicates that this dispatcher requires access to the class file declaring the advice method.
-
Field Details
-
adviceMethod
The advice method. -
delegatorFactory
The delegator factory to use.
-
-
Constructor Details
-
Delegating
protected Delegating(MethodDescription.InDefinedShape adviceMethod, Advice.Delegator.Factory delegatorFactory) Creates a new delegating advice dispatcher.- Parameters:
adviceMethod- The advice method.delegatorFactory- The delegator factory to use.
-
-
Method Details
-
isAlive
public boolean isAlive()Returnstrueif this dispatcher is alive.- Specified by:
isAlivein interfaceAdvice.Dispatcher- Returns:
trueif this dispatcher is alive.
-
isBinary
public boolean isBinary()Indicates that this dispatcher requires access to the class file declaring the advice method.- Specified by:
isBinaryin interfaceAdvice.Dispatcher.Unresolved- Returns:
trueif this dispatcher requires access to the advice method's class file.
-
getAdviceType
The type that is produced as a result of executing this advice method.- Specified by:
getAdviceTypein interfaceAdvice.Dispatcher- Returns:
- A description of the type that is produced by this advice method.
-
getNamedTypes
Returns the named types declared by this enter advice.- Specified by:
getNamedTypesin interfaceAdvice.Dispatcher.Unresolved- Returns:
- The named types declared by this enter advice.
-
asMethodEnter
public Advice.Dispatcher.Resolved.ForMethodEnter asMethodEnter(List<? extends Advice.OffsetMapping.Factory<?>> userFactories, @MaybeNull org.objectweb.asm.ClassReader classReader, Advice.Dispatcher.Unresolved methodExit, Advice.PostProcessor.Factory postProcessorFactory) Resolves this dispatcher as a dispatcher for entering a method.- Specified by:
asMethodEnterin interfaceAdvice.Dispatcher.Unresolved- Parameters:
userFactories- A list of custom factories for binding parameters of an advice method.classReader- A class reader to query for a class file which might benullif this dispatcher is not binary.methodExit- The unresolved dispatcher for the method exit advice.postProcessorFactory- The post processor factory to use.- Returns:
- This dispatcher as a dispatcher for entering a method.
-
asMethodExit
public Advice.Dispatcher.Resolved.ForMethodExit asMethodExit(List<? extends Advice.OffsetMapping.Factory<?>> userFactories, @MaybeNull org.objectweb.asm.ClassReader classReader, Advice.Dispatcher.Unresolved methodEnter, Advice.PostProcessor.Factory postProcessorFactory) Resolves this dispatcher as a dispatcher for exiting a method.- Specified by:
asMethodExitin interfaceAdvice.Dispatcher.Unresolved- Parameters:
userFactories- A list of custom factories for binding parameters of an advice method.classReader- A class reader to query for a class file which might benullif this dispatcher is not binary.methodEnter- The unresolved dispatcher for the method enter advice.postProcessorFactory- The post processor factory to use.- Returns:
- This dispatcher as a dispatcher for exiting a method.
-