|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalt.jiapi.util.HotSpotAdvisor
public class HotSpotAdvisor
HotSpotAdvisor is used to copy instructions from HotSpotAdvice to class being instrumented. This makes it possible to instrument target classes without any knowledge about Java bytecodes or instruction set.
Conseptually, this class, with the aid of HotSpotAdvise, provides the same thing as AspectJs' join-point, before advice, after advice and around advice.
At some point in time, we might add point-cut semantics here. At the moment, point-cut semantics can be simulated to some extent with the aid of InstrumentationDescriptor
At the moment there is not such thing as HotSpotContext. For example, HotSpotAdvice knows, that an invocation is being made, but it does not know what are the call parameters of the invocation, and it does not know what the invocation returned.
Future versions of HotSpotAdvice might have this knowledge.
HotSpotAdvice
,
for the definition of hotspot
Field Summary | |
---|---|
static byte[] |
FIELD_ACCESSES
This field can be used in constructor to search for hotspots, that do some sort of field access. |
static byte[] |
INVOCATIONS
This field can be used in constructor to search for any invocations being made. |
static byte[] |
RETURNS
This field can be used in constructor to search for hotspots, that makes a method return normally. |
Constructor Summary | |
---|---|
HotSpotAdvisor(InstrumentationDescriptor id,
HotSpotAdvice advice,
byte hotSpot)
Creates new HotSpotAdvisor. |
|
HotSpotAdvisor(InstrumentationDescriptor id,
HotSpotAdvice advice,
byte[] hotSpots)
Creates new HotSpotAdvisor. |
|
HotSpotAdvisor(InstrumentationDescriptor id,
HotSpotAdvice advice,
byte[] hotSpots,
java.lang.String resolution)
Creates new HotSpotAdvisor. |
Method Summary | |
---|---|
void |
checkForBranchTarget(Instruction firstHotSpotInstruction,
InstructionList methodList,
Instruction firstBeforeInstruction)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte[] FIELD_ACCESSES
public static final byte[] INVOCATIONS
byte[] invocations = new byte[] { Opcodes.INVOKESTATIC, Opcodes.INVOKEVIRTUAL, Opcodes.INVOKEINTERFACE };
public static final byte[] RETURNS
Constructor Detail |
---|
public HotSpotAdvisor(InstrumentationDescriptor id, HotSpotAdvice advice, byte hotSpot)
id
- InstrumentationDescriptor to use. A Special
instruction copy Instrumentor is added to this
descriptor, so users should only add inclusion/exclusion
rules to descriptor.advice
- A HotSpotAdvice where instructions to be copied are
taken.hotSpot
- this byte represents an opcode
of the hotspot.Opcodes
public HotSpotAdvisor(InstrumentationDescriptor id, HotSpotAdvice advice, byte[] hotSpots)
id
- InstrumentationDescriptor to use. A Special
instruction copy Instrumentor is added to this
descriptor, so users should only add inclusion/exclusion
rules to descriptor.advice
- A HotSpotAdvice where instructions to be copied are
taken.hotSpots
- an array of bytes. Each byte represents an opcode
of the hotspot. So, multiple opcodes may be used.INVOCATIONS
,
RETURNS
,
FIELD_ACCESSES
,
Opcodes
,
OpcodeGroups
public HotSpotAdvisor(InstrumentationDescriptor id, HotSpotAdvice advice, byte[] hotSpots, java.lang.String resolution)
id
- InstrumentationDescriptor to use. A Special
instruction copy Instrumentor is added to this
descriptor, so users should only add inclusion/exclusion
rules to descriptor.advice
- A HotSpotAdvice where instructions to be copied are
taken.hotSpots
- an array of bytes. Each byte represents an opcode
of the hotspot. So, multiple opcodes may be used.INVOCATIONS
,
RETURNS
,
FIELD_ACCESSES
,
Opcodes
,
OpcodeGroups
Method Detail |
---|
public void checkForBranchTarget(Instruction firstHotSpotInstruction, InstructionList methodList, Instruction firstBeforeInstruction)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |