public class InstrumentationContext extends java.lang.Object implements TraceDetailsList
InstrumentationContextManager. It keeps track
of the methods of the class that have been matched by different class transformers that are registered with the
manager.| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
bytes |
| Constructor and Description |
|---|
InstrumentationContext(byte[] bytes,
java.lang.Class<?> classBeingRedefined,
java.security.ProtectionDomain protectionDomain) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBridgeMethod(org.objectweb.asm.commons.Method method)
Add a bridged method to this context.
|
void |
addClassResolver(ClassResolver classResolver)
Adds a class resolver to the current context.
|
void |
addIgnoreApdexMethod(java.lang.String methodName,
java.lang.String methodDesc) |
void |
addIgnoreTransactionMethod(org.objectweb.asm.commons.Method m) |
void |
addIgnoreTransactionMethod(java.lang.String methodName,
java.lang.String methodDesc) |
void |
addOldInvokerStyleInstrumentationMethod(org.objectweb.asm.commons.Method method,
PointCut pointCut) |
void |
addOldReflectionStyleInstrumentationMethod(org.objectweb.asm.commons.Method method,
PointCut pointCut) |
void |
addScalaFinalField(java.lang.String fieldName) |
void |
addSkipMethod(org.objectweb.asm.commons.Method method,
java.lang.String owningClass) |
void |
addTimedMethods(org.objectweb.asm.commons.Method... methods)
Adds methods that are timed with method tracers.
|
void |
addTrace(org.objectweb.asm.commons.Method method,
TraceDetails traceDetails)
Adds a method to be traced (timed) by instrumentation injected by the
TraceClassVisitor. |
void |
addTracedMethods(java.util.Map<org.objectweb.asm.commons.Method,TraceDetails> tracedMethods)
Adds methods to be traced (timed) by instrumentation injected by the
TraceClassVisitor. |
void |
addWeavedMethod(org.objectweb.asm.commons.Method method,
java.lang.String instrumentationTitle)
Adds a weaved method.
|
java.util.Map<org.objectweb.asm.commons.Method,org.objectweb.asm.commons.Method> |
getBridgeMethods()
Returns a map of bridge methods.
|
java.lang.Class<?> |
getClassBeingRedefined() |
java.lang.String |
getClassName() |
ClassResolver |
getClassResolver(java.lang.ClassLoader loader)
Returns a class resolver that will delegate to the class resolvers added with
addClassResolver(ClassResolver). |
java.net.URL |
getCodeSourceLocation() |
java.lang.String[] |
getInterfaces() |
java.util.Map<ClassMatchVisitorFactory,OptimizedClassMatcher.Match> |
getMatches() |
java.util.Collection<java.lang.String> |
getMergeInstrumentationPackages(org.objectweb.asm.commons.Method method) |
PointCut |
getOldStylePointCut(org.objectweb.asm.commons.Method method) |
java.security.ProtectionDomain |
getProtectionDomain() |
java.util.Set<java.lang.String> |
getScalaFinalFields() |
java.util.Map<org.objectweb.asm.commons.Method,java.util.Collection<java.lang.String>> |
getSkipMethods() |
java.util.Set<org.objectweb.asm.commons.Method> |
getTimedMethods()
Returns methods that are timed with instrumentation injected by the new
TraceClassVisitor or the old
GenericClassAdapter. |
TraceInformation |
getTraceInformation() |
java.util.Set<org.objectweb.asm.commons.Method> |
getWeavedMethods() |
boolean |
hasModifiedClassStructure() |
boolean |
hasSourceAttribute()
Return true if the GeneratedClassDetector found that this class has a source attribute.
|
boolean |
isGenerated()
Return true if the GeneratedClassDetector identified this class as a generated class.
|
boolean |
isModified() |
boolean |
isModified(org.objectweb.asm.commons.Method method) |
boolean |
isTracerMatch() |
boolean |
isUsingLegacyInstrumentation() |
void |
markAsModified() |
void |
match(java.lang.ClassLoader loader,
java.lang.Class<?> classBeingRedefined,
org.objectweb.asm.ClassReader reader,
java.util.Collection<ClassMatchVisitorFactory> classVisitorFactories) |
void |
putMatch(ClassMatchVisitorFactory matcher,
OptimizedClassMatcher.Match match) |
void |
putTraceAnnotation(org.objectweb.asm.commons.Method method,
TraceDetails traceDetails) |
void |
setClassName(java.lang.String className) |
void |
setGenerated(boolean isGenerated) |
void |
setInterfaces(java.lang.String[] interfaces) |
void |
setSourceAttribute(boolean hasSource) |
public InstrumentationContext(byte[] bytes,
java.lang.Class<?> classBeingRedefined,
java.security.ProtectionDomain protectionDomain)
public java.lang.String[] getInterfaces()
public java.lang.String getClassName()
public java.lang.Class<?> getClassBeingRedefined()
public java.security.ProtectionDomain getProtectionDomain()
public void markAsModified()
public boolean isModified()
public TraceInformation getTraceInformation()
public boolean isTracerMatch()
public void addWeavedMethod(org.objectweb.asm.commons.Method method,
java.lang.String instrumentationTitle)
instrumentationTitle - The name of the instrumentation package from which the weaved code originated.public void addSkipMethod(org.objectweb.asm.commons.Method method,
java.lang.String owningClass)
public void addScalaFinalField(java.lang.String fieldName)
public PointCut getOldStylePointCut(org.objectweb.asm.commons.Method method)
public java.util.Set<org.objectweb.asm.commons.Method> getWeavedMethods()
public java.util.Map<org.objectweb.asm.commons.Method,java.util.Collection<java.lang.String>> getSkipMethods()
public java.util.Set<java.lang.String> getScalaFinalFields()
public java.util.Set<org.objectweb.asm.commons.Method> getTimedMethods()
TraceClassVisitor or the old
GenericClassAdapter.public java.util.Collection<java.lang.String> getMergeInstrumentationPackages(org.objectweb.asm.commons.Method method)
public boolean isModified(org.objectweb.asm.commons.Method method)
public void addTimedMethods(org.objectweb.asm.commons.Method... methods)
public void addOldReflectionStyleInstrumentationMethod(org.objectweb.asm.commons.Method method,
PointCut pointCut)
public void addOldInvokerStyleInstrumentationMethod(org.objectweb.asm.commons.Method method,
PointCut pointCut)
public java.util.Map<ClassMatchVisitorFactory,OptimizedClassMatcher.Match> getMatches()
public void putTraceAnnotation(org.objectweb.asm.commons.Method method,
TraceDetails traceDetails)
public void addIgnoreApdexMethod(java.lang.String methodName,
java.lang.String methodDesc)
public void addIgnoreTransactionMethod(java.lang.String methodName,
java.lang.String methodDesc)
public void addIgnoreTransactionMethod(org.objectweb.asm.commons.Method m)
public void putMatch(ClassMatchVisitorFactory matcher, OptimizedClassMatcher.Match match)
public void setInterfaces(java.lang.String[] interfaces)
public void setClassName(java.lang.String className)
public void addTracedMethods(java.util.Map<org.objectweb.asm.commons.Method,TraceDetails> tracedMethods)
TraceClassVisitor.public void addTrace(org.objectweb.asm.commons.Method method,
TraceDetails traceDetails)
TraceClassVisitor.addTrace in interface TraceDetailsListpublic void match(java.lang.ClassLoader loader,
java.lang.Class<?> classBeingRedefined,
org.objectweb.asm.ClassReader reader,
java.util.Collection<ClassMatchVisitorFactory> classVisitorFactories)
public void addBridgeMethod(org.objectweb.asm.commons.Method method)
Opcodes.ACC_BRIDGEpublic java.util.Map<org.objectweb.asm.commons.Method,org.objectweb.asm.commons.Method> getBridgeMethods()
public boolean isUsingLegacyInstrumentation()
public boolean hasModifiedClassStructure()
public void addClassResolver(ClassResolver classResolver)
public ClassResolver getClassResolver(java.lang.ClassLoader loader)
addClassResolver(ClassResolver). If those fail to resolve the class the given classloader is used.public void setGenerated(boolean isGenerated)
public boolean isGenerated()
public void setSourceAttribute(boolean hasSource)
public boolean hasSourceAttribute()
public java.net.URL getCodeSourceLocation()