Package org.jacoco.core.runtime
Class RemoteControlWriter
java.lang.Object
org.jacoco.core.data.ExecutionDataWriter
org.jacoco.core.runtime.RemoteControlWriter
- All Implemented Interfaces:
IExecutionDataVisitor,ISessionInfoVisitor,IRemoteCommandVisitor
ExecutionDataWriter with commands added for runtime remote control.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteBlock identifier for dump commandstatic final byteBlock identifier to confirm successful command execution.Fields inherited from class org.jacoco.core.data.ExecutionDataWriter
BLOCK_EXECUTIONDATA, BLOCK_HEADER, BLOCK_SESSIONINFO, FORMAT_VERSION, MAGIC_NUMBER, out -
Constructor Summary
ConstructorsConstructorDescriptionRemoteControlWriter(OutputStream output) Creates a new writer based on the given output stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidSends a confirmation that a commands has been successfully executed and the response is completed.voidvisitDumpCommand(boolean dump, boolean reset) Requests an execution data dump with an optional reset.Methods inherited from class org.jacoco.core.data.ExecutionDataWriter
flush, getFileHeader, visitClassExecution, visitSessionInfo
-
Field Details
-
BLOCK_CMDOK
public static final byte BLOCK_CMDOKBlock identifier to confirm successful command execution.- See Also:
-
BLOCK_CMDDUMP
public static final byte BLOCK_CMDDUMPBlock identifier for dump command- See Also:
-
-
Constructor Details
-
RemoteControlWriter
Creates a new writer based on the given output stream. Depending on the nature of the underlying stream output should be buffered as most data is written in single bytes. Should be buffered when used to write execution data toSocket.getOutputStream(). Should not be buffered when used only for commands because they are short and this will merely add memory overhead.- Parameters:
output- stream to write commands to- Throws:
IOException- if the header can't be written
-
-
Method Details
-
sendCmdOk
Sends a confirmation that a commands has been successfully executed and the response is completed.- Throws:
IOException- in case of problems with the remote connection
-
visitDumpCommand
Description copied from interface:IRemoteCommandVisitorRequests an execution data dump with an optional reset.- Specified by:
visitDumpCommandin interfaceIRemoteCommandVisitor- Parameters:
dump-trueif the dump should be executedreset-trueif the reset should be executed- Throws:
IOException- in case of problems with the remote connection
-