protected abstract static class Advice.AdviceVisitor.WithExitAdvice extends Advice.AdviceVisitor
Modifier and Type | Class and Description |
---|---|
protected static class |
Advice.AdviceVisitor.WithExitAdvice.WithExceptionHandling
An advice visitor that captures exceptions by weaving try-catch blocks around user code.
|
protected static class |
Advice.AdviceVisitor.WithExitAdvice.WithoutExceptionHandling
An advice visitor that does not capture exceptions.
|
Advice.AdviceVisitor.WithExitAdvice, Advice.AdviceVisitor.WithoutExitAdvice
Advice.Dispatcher.RelocationHandler.Relocation.ForLabel
Modifier and Type | Field and Description |
---|---|
protected Label |
returnHandler
Indicates the handler for the value returned by the advice method.
|
argumentHandler, instrumentedMethod, methodExit, methodSizeHandler, methodVisitor, stackMapFrameHandler
api, mv
Modifier | Constructor and Description |
---|---|
protected |
WithExitAdvice(MethodVisitor methodVisitor,
Implementation.Context implementationContext,
Assigner assigner,
StackManipulation exceptionHandler,
TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
Advice.Dispatcher.Resolved.ForMethodEnter methodEnter,
Advice.Dispatcher.Resolved.ForMethodExit methodExit,
List<? extends TypeDescription> postMethodTypes,
int writerFlags,
int readerFlags)
Creates an advice visitor that applies exit advice.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(MethodVisitor methodVisitor)
Applies this relocator.
|
protected abstract void |
onExitAdviceReturn()
Invoked after the exit advice method has returned.
|
protected void |
onUserEnd()
Writes the advice for completing the instrumented method.
|
protected abstract void |
onUserReturn()
Invoked after the user method has returned.
|
protected void |
onVisitInsn(int opcode)
Visits a simple instruction.
|
onAfterExceptionTable, onUserPrepare, onUserStart, onVisitIincInsn, onVisitVarInsn, visitFrame, visitLocalVariable, visitLocalVariableAnnotation, visitMaxs
onVisitFieldInsn, onVisitIntInsn, onVisitInvokeDynamicInsn, onVisitJumpInsn, onVisitLabel, onVisitLdcInsn, onVisitLookupSwitchInsn, onVisitMethodInsn, onVisitMethodInsn, onVisitMultiANewArrayInsn, onVisitTableSwitchInsn, onVisitTypeInsn, visitFieldInsn, visitIincInsn, visitInsn, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLookupSwitchInsn, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitTableSwitchInsn, visitTypeInsn, visitVarInsn
visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitInsnAnnotation, visitLineNumber, visitParameter, visitParameterAnnotation, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation
protected final Label returnHandler
protected WithExitAdvice(MethodVisitor methodVisitor, Implementation.Context implementationContext, Assigner assigner, StackManipulation exceptionHandler, TypeDescription instrumentedType, MethodDescription instrumentedMethod, Advice.Dispatcher.Resolved.ForMethodEnter methodEnter, Advice.Dispatcher.Resolved.ForMethodExit methodExit, List<? extends TypeDescription> postMethodTypes, int writerFlags, int readerFlags)
methodVisitor
- The method visitor for the instrumented method.implementationContext
- The implementation context to use.assigner
- The assigner to use.exceptionHandler
- The stack manipulation to apply within a suppression handler.instrumentedType
- A description of the instrumented type.instrumentedMethod
- A description of the instrumented method.methodEnter
- The dispatcher to be used for method enter.methodExit
- The dispatcher to be used for method exit.postMethodTypes
- A list of virtual method arguments that are available after the instrumented method has completed.writerFlags
- The ASM writer flags that were set.readerFlags
- The ASM reader flags that were set.public void apply(MethodVisitor methodVisitor)
methodVisitor
- The method visitor to use.protected void onVisitInsn(int opcode)
ExceptionTableSensitiveMethodVisitor
onVisitInsn
in class ExceptionTableSensitiveMethodVisitor
opcode
- The opcode of the instruction.protected void onUserEnd()
Advice.AdviceVisitor
onUserEnd
in class Advice.AdviceVisitor
protected abstract void onUserReturn()
protected abstract void onExitAdviceReturn()
Copyright © 2014–2020. All rights reserved.