|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jacoco.core.runtime.AbstractRuntime
org.jacoco.core.runtime.ModifiedSystemClassRuntime
public class ModifiedSystemClassRuntime
This IRuntime
implementation works with a modified system class. A
new static method is added to a bootstrap class that will be used by
instrumented classes. As the system class itself needs to be instrumented
this runtime requires a Java agent.
Field Summary |
---|
Fields inherited from class org.jacoco.core.runtime.AbstractRuntime |
---|
store |
Constructor Summary | |
---|---|
ModifiedSystemClassRuntime(Class<?> systemClass,
String accessMethod,
String dataField)
Creates a new runtime based on the given class and members. |
Method Summary | |
---|---|
static IRuntime |
createFor(Instrumentation inst,
String className)
Creates a new ModifiedSystemClassRuntime using the given class as
the data container. |
static IRuntime |
createFor(Instrumentation inst,
String className,
String accessMethod,
String dataField)
Creates a new ModifiedSystemClassRuntime using the given class as
the data container. |
int |
generateDataAccessor(long classid,
MethodVisitor mv)
This method generates the byte code required to obtain the coverage data structure for the class with the given id. |
static byte[] |
instrument(byte[] source,
String accessMethod,
String dataField)
Adds the static access method and data field to the given class definition. |
void |
shutdown()
Allows the coverage runtime to cleanup internals. |
void |
startup()
Starts the coverage runtime. |
Methods inherited from class org.jacoco.core.runtime.AbstractRuntime |
---|
collect, registerClass, reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ModifiedSystemClassRuntime(Class<?> systemClass, String accessMethod, String dataField)
systemClass
- system class that contains the execution dataaccessMethod
- name of the public static access methoddataField
- name of the public static data fieldMethod Detail |
---|
public void startup() throws Exception
IRuntime
Exception
- any internal problem during startuppublic void shutdown()
IRuntime
public int generateDataAccessor(long classid, MethodVisitor mv)
IRuntime
boolean[]
instance to the
operand stack. Except this result object the generated code must not make
any assumptions about the structure of the embedding method or class.
classid
- identifier of the classmv
- code output
public static IRuntime createFor(Instrumentation inst, String className) throws ClassNotFoundException
ModifiedSystemClassRuntime
using the given class as
the data container. Members are creates with internal default names. The
given class must not have been loaded before by the agent.
inst
- instrumentation interfaceclassName
- VM name of the class to use
ClassNotFoundException
- id the given class can not be foundpublic static IRuntime createFor(Instrumentation inst, String className, String accessMethod, String dataField) throws ClassNotFoundException
ModifiedSystemClassRuntime
using the given class as
the data container. The given class must not have been loaded before by
the agent.
inst
- instrumentation interfaceclassName
- VM name of the class to useaccessMethod
- name of the added access methoddataField
- name of the added data field
ClassNotFoundException
- id the given class can not be foundpublic static byte[] instrument(byte[] source, String accessMethod, String dataField)
source
- class definition sourceaccessMethod
- name of the access methoddataField
- name of the data field
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |