Package org.jacoco.agent.rt.internal
Class PreMain
- java.lang.Object
-
- org.jacoco.agent.rt.internal.PreMain
-
public final class PreMain extends java.lang.ObjectThe agent which is referred as thePremain-Class. The agent configuration is provided with the agent parameters in the command line.
-
-
Constructor Summary
Constructors Modifier Constructor Description privatePreMain()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static IRuntimecreateRuntime(java.lang.instrument.Instrumentation inst)private static java.lang.ObjectgetModule(java.lang.Class<?> cls)static voidpremain(java.lang.String options, java.lang.instrument.Instrumentation inst)This method is called by the JVM to initialize Java agents.private static booleanredefineJavaBaseModule(java.lang.instrument.Instrumentation instrumentation)Opensjava.basemodule forInjectedClassRuntimewhen executed on Java 9 JREs or higher.
-
-
-
Method Detail
-
premain
public static void premain(java.lang.String options, java.lang.instrument.Instrumentation inst) throws java.lang.ExceptionThis method is called by the JVM to initialize Java agents.- Parameters:
options- agent optionsinst- instrumentation callback provided by the JVM- Throws:
java.lang.Exception- in case initialization fails
-
createRuntime
private static IRuntime createRuntime(java.lang.instrument.Instrumentation inst) throws java.lang.Exception
- Throws:
java.lang.Exception
-
redefineJavaBaseModule
private static boolean redefineJavaBaseModule(java.lang.instrument.Instrumentation instrumentation) throws java.lang.ExceptionOpensjava.basemodule forInjectedClassRuntimewhen executed on Java 9 JREs or higher.- Returns:
truewhen running on Java 9 or higher,falseotherwise- Throws:
java.lang.Exception- if unable to open
-
getModule
private static java.lang.Object getModule(java.lang.Class<?> cls) throws java.lang.Exception- Returns:
cls.getModule()- Throws:
java.lang.Exception
-
-