Class FileOutput
- java.lang.Object
-
- org.jacoco.agent.rt.internal.output.FileOutput
-
- All Implemented Interfaces:
IAgentOutput
public class FileOutput extends java.lang.Object implements IAgentOutput
Local only agent output that will write coverage data to the filesystem. This controller uses the following agent options:- destfile
- append
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
append
private RuntimeData
data
private java.io.File
destFile
private static int
LOCK_RETRY_COUNT
private static long
LOCK_RETRY_WAIT_TIME_MS
-
Constructor Summary
Constructors Constructor Description FileOutput()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.io.OutputStream
openFile()
void
shutdown()
Shutdown the agent controller and clean up any resources it has created.void
startup(AgentOptions options, RuntimeData data)
Configure the agent controller with the supplied options and connect it to the coverage runtimevoid
writeExecutionData(boolean reset)
Write all execution data in the runtime to a location determined by the agent controller.
-
-
-
Field Detail
-
LOCK_RETRY_COUNT
private static final int LOCK_RETRY_COUNT
- See Also:
- Constant Field Values
-
LOCK_RETRY_WAIT_TIME_MS
private static final long LOCK_RETRY_WAIT_TIME_MS
- See Also:
- Constant Field Values
-
data
private RuntimeData data
-
destFile
private java.io.File destFile
-
append
private boolean append
-
-
Method Detail
-
startup
public final void startup(AgentOptions options, RuntimeData data) throws java.io.IOException
Description copied from interface:IAgentOutput
Configure the agent controller with the supplied options and connect it to the coverage runtime- Specified by:
startup
in interfaceIAgentOutput
- Parameters:
options
- Options used to configure the agent controllerdata
- Execution data for this agent- Throws:
java.io.IOException
-
writeExecutionData
public void writeExecutionData(boolean reset) throws java.io.IOException
Description copied from interface:IAgentOutput
Write all execution data in the runtime to a location determined by the agent controller. This method should only be called by the Agent- Specified by:
writeExecutionData
in interfaceIAgentOutput
- Parameters:
reset
- iftrue
execution data is cleared afterwards- Throws:
java.io.IOException
- in case writing fails
-
shutdown
public void shutdown() throws java.io.IOException
Description copied from interface:IAgentOutput
Shutdown the agent controller and clean up any resources it has created.- Specified by:
shutdown
in interfaceIAgentOutput
- Throws:
java.io.IOException
-
openFile
private java.io.OutputStream openFile() throws java.io.IOException
- Throws:
java.io.IOException
-
-