Package org.jacoco.agent.rt.internal
Class PreMain
java.lang.Object
org.jacoco.agent.rt.internal.PreMain
The agent which is referred as the
Premain-Class
. The agent
configuration is provided with the agent parameters in the command line.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static IRuntime
createRuntime
(Instrumentation inst) private static Object
static void
premain
(String options, Instrumentation inst) This method is called by the JVM to initialize Java agents.private static boolean
redefineJavaBaseModule
(Instrumentation instrumentation) Opensjava.base
module forInjectedClassRuntime
when executed on Java 9 JREs or higher.
-
Constructor Details
-
PreMain
private PreMain()
-
-
Method Details
-
premain
This method is called by the JVM to initialize Java agents.- Parameters:
options
- agent optionsinst
- instrumentation callback provided by the JVM- Throws:
Exception
- in case initialization fails
-
createRuntime
- Throws:
Exception
-
redefineJavaBaseModule
Opensjava.base
module forInjectedClassRuntime
when executed on Java 9 JREs or higher.- Returns:
true
when running on Java 9 or higher,false
otherwise- Throws:
Exception
- if unable to open
-
getModule
- Returns:
cls.getModule()
- Throws:
Exception
-