Package org.jacoco.agent.rt.internal
Class Agent
- java.lang.Object
-
- org.jacoco.agent.rt.internal.Agent
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddump(boolean reset)Triggers a dump of the current execution data through the configured output.RuntimeDatagetData()Returns the runtime data object created by this agentbyte[]getExecutionData(boolean reset)Returns current execution data.static AgentgetInstance()Returns a global instance which is already started.static AgentgetInstance(AgentOptions options)Returns a global instance which is already started.java.lang.StringgetSessionId()Returns current a session identifier.java.lang.StringgetVersion()Returns version of JaCoCo.voidreset()Resets all coverage information.voidsetSessionId(java.lang.String id)Sets a session identifier.voidshutdown()Shutdown the agent again.voidstartup()Initializes this agent.
-
-
-
Method Detail
-
getInstance
public static Agent getInstance(AgentOptions options)
Returns a global instance which is already started. If the method is called the first time the instance is created with the given options.- Parameters:
options- options to configure the instance- Returns:
- global instance
-
getInstance
public static Agent getInstance() throws java.lang.IllegalStateException
Returns a global instance which is already started. If a agent has not been initialized before this method will fail.- Returns:
- global instance
- Throws:
java.lang.IllegalStateException- if no Agent has been started yet
-
getData
public RuntimeData getData()
Returns the runtime data object created by this agent- Returns:
- runtime data for this agent instance
-
startup
public void startup()
Initializes this agent.
-
shutdown
public void shutdown()
Shutdown the agent again.
-
getVersion
public java.lang.String getVersion()
Description copied from interface:IAgentReturns version of JaCoCo.- Specified by:
getVersionin interfaceIAgent- Returns:
- version of JaCoCo
-
getSessionId
public java.lang.String getSessionId()
Description copied from interface:IAgentReturns current a session identifier.- Specified by:
getSessionIdin interfaceIAgent- Returns:
- current session identifier
-
setSessionId
public void setSessionId(java.lang.String id)
Description copied from interface:IAgentSets a session identifier.- Specified by:
setSessionIdin interfaceIAgent- Parameters:
id- new session identifier
-
reset
public void reset()
Description copied from interface:IAgentResets all coverage information.
-
getExecutionData
public byte[] getExecutionData(boolean reset)
Description copied from interface:IAgentReturns current execution data.- Specified by:
getExecutionDatain interfaceIAgent- Parameters:
reset- iftruethe current execution data is cleared afterwards- Returns:
- dump of current execution data in JaCoCo binary format
-
dump
public void dump(boolean reset) throws java.io.IOExceptionDescription copied from interface:IAgentTriggers a dump of the current execution data through the configured output.
-
-