Package net.bytebuddy.asm
Class Advice.Dispatcher.Delegating.Resolved<T extends Advice.Dispatcher.Bound>
- java.lang.Object
-
- net.bytebuddy.asm.Advice.Dispatcher.Delegating.Resolved<T>
-
- Type Parameters:
T
- The type of advice dispatcher that is bound.
- All Implemented Interfaces:
Advice.Dispatcher
,Advice.Dispatcher.Resolved
- Direct Known Subclasses:
Advice.Dispatcher.Delegating.Resolved.ForMethodEnter
,Advice.Dispatcher.Delegating.Resolved.ForMethodExit
- Enclosing class:
- Advice.Dispatcher.Delegating
protected abstract static class Advice.Dispatcher.Delegating.Resolved<T extends Advice.Dispatcher.Bound> extends java.lang.Object implements Advice.Dispatcher.Resolved
A resolved version of a dispatcher.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
Advice.Dispatcher.Delegating.Resolved.AdviceMethodWriter
A bound advice method that copies the code by first extracting the exception table and later appending the code of the method without copying any meta data.protected static class
Advice.Dispatcher.Delegating.Resolved.ForMethodEnter
A resolved dispatcher for implementing method enter advice.protected static class
Advice.Dispatcher.Delegating.Resolved.ForMethodExit
A resolved dispatcher for implementing method exit advice.-
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.Resolved, Advice.Dispatcher.SuppressionHandler, Advice.Dispatcher.Unresolved
-
-
Field Summary
Fields Modifier and Type Field Description protected MethodDescription.InDefinedShape
adviceMethod
The represented advice method.protected java.util.List<Advice.OffsetMapping>
offsetMappings
An unresolved mapping of offsets of the advice method based on the annotations discovered on each method parameter.protected Advice.Dispatcher.SuppressionHandler
suppressionHandler
The suppression handler to use.-
Fields inherited from interface net.bytebuddy.asm.Advice.Dispatcher
IGNORE_ANNOTATION, IGNORE_METHOD
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Resolved(MethodDescription.InDefinedShape adviceMethod, java.util.List<? extends Advice.OffsetMapping.Factory<?>> factories, TypeDescription throwableType)
Creates a new resolved version of a dispatcher.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, Assigner assigner, Advice.MethodSizeHandler.ForInstrumentedMethod methodSizeHandler, Advice.StackMapFrameHandler.ForInstrumentedMethod stackMapFrameHandler, StackManipulation exceptionHandler)
Binds this dispatcher for resolution to a specific method.boolean
equals(java.lang.Object object)
int
hashCode()
boolean
isAlive()
Returnstrue
if this dispatcher is alive.protected abstract T
resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, Assigner assigner, Advice.MethodSizeHandler.ForInstrumentedMethod methodSizeHandler, Advice.StackMapFrameHandler.ForInstrumentedMethod stackMapFrameHandler, StackManipulation exceptionHandler)
Binds this dispatcher for resolution to a specific method.
-
-
-
Field Detail
-
adviceMethod
protected final MethodDescription.InDefinedShape adviceMethod
The represented advice method.
-
offsetMappings
protected final java.util.List<Advice.OffsetMapping> offsetMappings
An unresolved mapping of offsets of the advice method based on the annotations discovered on each method parameter.
-
suppressionHandler
protected final Advice.Dispatcher.SuppressionHandler suppressionHandler
The suppression handler to use.
-
-
Constructor Detail
-
Resolved
protected Resolved(MethodDescription.InDefinedShape adviceMethod, java.util.List<? extends Advice.OffsetMapping.Factory<?>> factories, TypeDescription throwableType)
Creates a new resolved version of a dispatcher.- Parameters:
adviceMethod
- The represented advice method.factories
- A list of factories to resolve for the parameters of the advice method.throwableType
- The type to handle by a suppression handler orAdvice.NoExceptionHandler
to not handle any exceptions.
-
-
Method Detail
-
isAlive
public boolean isAlive()
Description copied from interface:Advice.Dispatcher
Returnstrue
if this dispatcher is alive.- Specified by:
isAlive
in interfaceAdvice.Dispatcher
- Returns:
true
if this dispatcher is alive.
-
bind
public T bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, Assigner assigner, Advice.MethodSizeHandler.ForInstrumentedMethod methodSizeHandler, Advice.StackMapFrameHandler.ForInstrumentedMethod stackMapFrameHandler, StackManipulation exceptionHandler)
Description copied from interface:Advice.Dispatcher.Resolved
Binds this dispatcher for resolution to a specific method.- Specified by:
bind
in interfaceAdvice.Dispatcher.Resolved
- Parameters:
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.methodVisitor
- The method visitor for writing the instrumented method.implementationContext
- The implementation context to use.assigner
- The assigner to use.methodSizeHandler
- A handler for computing the method size requirements.stackMapFrameHandler
- A handler for translating and injecting stack map frames.exceptionHandler
- The stack manipulation to apply within a suppression handler.- Returns:
- A dispatcher that is bound to the instrumented method.
-
resolve
protected abstract T resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, Assigner assigner, Advice.MethodSizeHandler.ForInstrumentedMethod methodSizeHandler, Advice.StackMapFrameHandler.ForInstrumentedMethod stackMapFrameHandler, StackManipulation exceptionHandler)
Binds this dispatcher for resolution to a specific method.- Parameters:
instrumentedType
- A description of the instrumented type.instrumentedMethod
- The instrumented method that is being bound.methodVisitor
- The method visitor for writing to the instrumented method.implementationContext
- The implementation context to use.assigner
- The assigner to use.methodSizeHandler
- A handler for computing the method size requirements.stackMapFrameHandler
- A handler for translating and injecting stack map frames.exceptionHandler
- The stack manipulation to apply within a suppression handler.- Returns:
- An appropriate bound advice dispatcher.
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-