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 TypeList |
expectedTypes
A list of intermediate types to be considered as part of the instrumented method's steady signature.
|
protected MethodDescription.InDefinedShape |
instrumentedMethod
The instrumented method.
|
UNDEFINED_SIZE
Modifier | Constructor and Description |
---|---|
protected |
Default(MethodDescription.InDefinedShape instrumentedMethod,
TypeList expectedTypes,
boolean expandFrames)
Creates a new default meta data handler.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Advice.MetaDataHandler.Default.ForAdvice |
bind(MethodDescription.InDefinedShape methodDescription,
TypeList expectedTypes,
List<? extends TypeDescription> yieldedTypes,
Advice.MetaDataHandler.Default.TranslationMode translationMode)
Binds the given advice method to an appropriate meta data handler.
|
Advice.MetaDataHandler.Default.ForAdvice |
bindEntry(MethodDescription.InDefinedShape methodDescription)
Binds this meta data handler for the entry advice.
|
Advice.MetaDataHandler.Default.ForAdvice |
bindExit(MethodDescription.InDefinedShape methodDescription)
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,
TypeList expectedTypes,
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, wait
compoundLocalVariableLength, compoundStackSize
protected final MethodDescription.InDefinedShape instrumentedMethod
protected final TypeList expectedTypes
protected Default(MethodDescription.InDefinedShape instrumentedMethod, TypeList expectedTypes, boolean expandFrames)
instrumentedMethod
- The instrumented method.expectedTypes
- A list of intermediate types to be considered as part of the instrumented method's steady signature.expandFrames
- true
if the meta data handler is expected to expand its frames.protected static Advice.MetaDataHandler.ForInstrumentedMethod of(MethodDescription.InDefinedShape instrumentedMethod, TypeList expectedTypes, int writerFlags, int readerFlags)
instrumentedMethod
- The instrumented method.expectedTypes
- The additional types that are added by the entry advice.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 methodDescription)
Advice.MetaDataHandler.ForInstrumentedMethod
bindEntry
in interface Advice.MetaDataHandler.ForInstrumentedMethod
methodDescription
- The entry advice method.public Advice.MetaDataHandler.Default.ForAdvice bindExit(MethodDescription.InDefinedShape methodDescription)
Advice.MetaDataHandler.ForInstrumentedMethod
bindExit
in interface Advice.MetaDataHandler.ForInstrumentedMethod
methodDescription
- The exit advice method.protected abstract Advice.MetaDataHandler.Default.ForAdvice bind(MethodDescription.InDefinedShape methodDescription, TypeList expectedTypes, List<? extends TypeDescription> yieldedTypes, Advice.MetaDataHandler.Default.TranslationMode translationMode)
methodDescription
- The advice method.expectedTypes
- 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.ForInstrumentedMethod
getReaderHint
in interface Advice.MetaDataHandler.ForInstrumentedMethod
public void translateFrame(MethodVisitor methodVisitor, int type, int localVariableLength, Object[] localVariable, int stackSize, Object[] stack)
Advice.MetaDataHandler
translateFrame
in interface Advice.MetaDataHandler
methodVisitor
- 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.MetaDataHandler
injectHandlerFrame
in interface Advice.MetaDataHandler
methodVisitor
- The method visitor to write the frame to.public void injectCompletionFrame(MethodVisitor methodVisitor, boolean secondary)
Advice.MetaDataHandler
injectCompletionFrame
in interface Advice.MetaDataHandler
methodVisitor
- 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.