public abstract static class Advice.MetaDataHandler.Default extends Object implements Advice.MetaDataHandler.ForInstrumentedMethod
| Modifier and Type | Class and Description |
|---|---|
protected class |
Advice.MetaDataHandler.Default.ForAdvice
A meta data handler that is bound to an advice method.
|
protected static class |
Advice.MetaDataHandler.Default.TranslationMode
A translation mode that determines how the fixed frames of the instrumented method are written.
|
protected static class |
Advice.MetaDataHandler.Default.WithoutStackSizeComputation
A default meta data handler that does not recompute the space requirements of an instrumented method.
|
protected static class |
Advice.MetaDataHandler.Default.WithStackSizeComputation
A default meta data handler that recomputes the space requirements of an instrumented method.
|
Advice.MetaDataHandler.Default, Advice.MetaDataHandler.ForInstrumentedMethod, Advice.MetaDataHandler.NoOp| Modifier and Type | Field and Description |
|---|---|
protected MethodDescription.InDefinedShape |
instrumentedMethod
The instrumented method.
|
protected TypeList |
requiredTypes
A list of intermediate types to be considered as part of the instrumented method's steady signature.
|
protected TypeList |
yieldedTypes
The types that are expected to be added after the instrumented method returns.
|
UNDEFINED_SIZE| Modifier | Constructor and Description |
|---|---|
protected |
Default(MethodDescription.InDefinedShape instrumentedMethod,
TypeList requiredTypes,
TypeList yieldedTypes,
boolean expandFrames)
Creates a new default meta data handler.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract Advice.MetaDataHandler.Default.ForAdvice |
bind(MethodDescription.InDefinedShape adviceMethod,
TypeList requiredTypes,
TypeList yieldedTypes,
Advice.MetaDataHandler.Default.TranslationMode translationMode)
Binds the given advice method to an appropriate meta data handler.
|
Advice.MetaDataHandler.Default.ForAdvice |
bindEntry(MethodDescription.InDefinedShape adviceMethod)
Binds this meta data handler for the entry advice.
|
Advice.MetaDataHandler.Default.ForAdvice |
bindExit(MethodDescription.InDefinedShape adviceMethod)
Binds this meta data handler for the exit advice.
|
int |
getReaderHint()
Returns the reader hint to apply when parsing the advice method.
|
void |
injectCompletionFrame(MethodVisitor methodVisitor,
boolean secondary)
Injects a frame after a method's completion.
|
protected void |
injectFullFrame(MethodVisitor methodVisitor,
List<? extends TypeDescription> additionalTypes,
boolean exceptionOnStack)
Injects a full frame.
|
void |
injectHandlerFrame(MethodVisitor methodVisitor)
Injects a frame for a method's exception handler.
|
protected static Advice.MetaDataHandler.ForInstrumentedMethod |
of(MethodDescription.InDefinedShape instrumentedMethod,
List<? extends TypeDescription> requiredTypes,
List<? extends TypeDescription> yieldedTypes,
int writerFlags,
int readerFlags)
Creates an appropriate meta data handler for an instrumented method based on the context of the method creation.
|
protected static Object |
toFrame(TypeDescription typeDescription)
Translates a type into a representation of its form inside a stack map frame.
|
protected void |
translateFrame(MethodVisitor methodVisitor,
Advice.MetaDataHandler.Default.TranslationMode translationMode,
MethodDescription.InDefinedShape methodDescription,
TypeList additionalTypes,
int frameType,
int localVariableLength,
Object[] localVariable,
int stackSize,
Object[] stack)
Translates a frame.
|
void |
translateFrame(MethodVisitor methodVisitor,
int type,
int localVariableLength,
Object[] localVariable,
int stackSize,
Object[] stack)
Translates a frame.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompoundLocalVariableLength, compoundStackSizeprotected final MethodDescription.InDefinedShape instrumentedMethod
protected final TypeList requiredTypes
protected final TypeList yieldedTypes
protected Default(MethodDescription.InDefinedShape instrumentedMethod, TypeList requiredTypes, TypeList yieldedTypes, boolean expandFrames)
instrumentedMethod - The instrumented method.requiredTypes - A list of intermediate types to be considered as part of the instrumented method's steady signature.yieldedTypes - The types that are expected to be added after the instrumented method returns.expandFrames - true if the meta data handler is expected to expand its frames.protected static Advice.MetaDataHandler.ForInstrumentedMethod of(MethodDescription.InDefinedShape instrumentedMethod, List<? extends TypeDescription> requiredTypes, List<? extends TypeDescription> yieldedTypes, int writerFlags, int readerFlags)
instrumentedMethod - The instrumented method.requiredTypes - The additional types that are added by the entry advice.yieldedTypes - The types that are expected to be added after the instrumented method returns.writerFlags - The ASM flags supplied to the ClassWriter.readerFlags - The ASM flags supplied to the ClassReader.protected static Object toFrame(TypeDescription typeDescription)
typeDescription - The type to translate.public Advice.MetaDataHandler.Default.ForAdvice bindEntry(MethodDescription.InDefinedShape adviceMethod)
Advice.MetaDataHandler.ForInstrumentedMethodbindEntry in interface Advice.MetaDataHandler.ForInstrumentedMethodadviceMethod - The entry advice method.public Advice.MetaDataHandler.Default.ForAdvice bindExit(MethodDescription.InDefinedShape adviceMethod)
Advice.MetaDataHandler.ForInstrumentedMethodbindExit in interface Advice.MetaDataHandler.ForInstrumentedMethodadviceMethod - The exit advice method.protected abstract Advice.MetaDataHandler.Default.ForAdvice bind(MethodDescription.InDefinedShape adviceMethod, TypeList requiredTypes, TypeList yieldedTypes, Advice.MetaDataHandler.Default.TranslationMode translationMode)
adviceMethod - The advice method.requiredTypes - The expected types that the advice method requires additionally to the instrumented method's parameters.yieldedTypes - The types this advice method yields as additional parameters.translationMode - The translation mode to apply for this advice.public int getReaderHint()
Advice.MetaDataHandler.ForInstrumentedMethodgetReaderHint in interface Advice.MetaDataHandler.ForInstrumentedMethodpublic void translateFrame(MethodVisitor methodVisitor, int type, int localVariableLength, Object[] localVariable, int stackSize, Object[] stack)
Advice.MetaDataHandlertranslateFrame in interface Advice.MetaDataHandlermethodVisitor - The method visitor to write the frame to.type - The frame's type.localVariableLength - The local variable length.localVariable - An array containing the types of the current local variables.stackSize - The size of the operand stack.stack - An array containing the types of the current operand stack.protected void translateFrame(MethodVisitor methodVisitor, Advice.MetaDataHandler.Default.TranslationMode translationMode, MethodDescription.InDefinedShape methodDescription, TypeList additionalTypes, int frameType, int localVariableLength, Object[] localVariable, int stackSize, Object[] stack)
methodVisitor - The method visitor to write the frame to.translationMode - The translation mode to apply.methodDescription - The method description for which the frame is written.additionalTypes - The additional types to consider part of the instrumented method's parameters.frameType - The frame's type.localVariableLength - The local variable length.localVariable - An array containing the types of the current local variables.stackSize - The size of the operand stack.stack - An array containing the types of the current operand stack.public void injectHandlerFrame(MethodVisitor methodVisitor)
Advice.MetaDataHandlerinjectHandlerFrame in interface Advice.MetaDataHandlermethodVisitor - The method visitor to write the frame to.public void injectCompletionFrame(MethodVisitor methodVisitor, boolean secondary)
Advice.MetaDataHandlerinjectCompletionFrame in interface Advice.MetaDataHandlermethodVisitor - The method visitor to write the frame to.secondary - true if the frame is written a second time.protected void injectFullFrame(MethodVisitor methodVisitor, List<? extends TypeDescription> additionalTypes, boolean exceptionOnStack)
methodVisitor - The method visitor for which the frame should be written.additionalTypes - The additional types that are considered to be part of the method's parameters.exceptionOnStack - true if there is a Throwable on the operand stack.Copyright © 2014–2016. All rights reserved.