Class TcpClientOutput
java.lang.Object
org.jacoco.agent.rt.internal.output.TcpClientOutput
- All Implemented Interfaces:
IAgentOutput
Output that connects to a TCP port. This controller uses the following agent
options:
- address
- port
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TcpConnection
private final IExceptionLogger
private Thread
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Socket
createSocket
(AgentOptions options) Open a socket based on the given configuration.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 Details
-
logger
-
connection
-
worker
-
-
Constructor Details
-
TcpClientOutput
New controller instance.- Parameters:
logger
- logger to use in case of exceptions is spawned threads
-
-
Method Details
-
startup
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:
IOException
-
shutdown
Description copied from interface:IAgentOutput
Shutdown the agent controller and clean up any resources it has created.- Specified by:
shutdown
in interfaceIAgentOutput
- Throws:
Exception
- in case shutdown fails
-
writeExecutionData
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:
IOException
- in case writing fails
-
createSocket
Open a socket based on the given configuration.- Parameters:
options
- address and port configuration- Returns:
- opened socket
- Throws:
IOException
-