Class TcpServerOutput
java.lang.Object
org.jacoco.agent.rt.internal.output.TcpServerOutput
- All Implemented Interfaces:
IAgentOutput
Output that opens TCP server socket. This controller uses the following agent
options:
- address
- port
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TcpConnectionprivate final IExceptionLoggerprivate ServerSocketprivate Thread -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ServerSocketcreateServerSocket(AgentOptions options) Open a server socket based on the given configuration.protected InetAddressgetInetAddress(String address) Returns theInetAddressobject to open the server socket on.voidshutdown()Shutdown the agent controller and clean up any resources it has created.voidstartup(AgentOptions options, RuntimeData data) Configure the agent controller with the supplied options and connect it to the coverage runtimevoidwriteExecutionData(boolean reset) Write all execution data in the runtime to a location determined by the agent controller.
-
Field Details
-
connection
-
logger
-
serverSocket
-
worker
-
-
Constructor Details
-
TcpServerOutput
New controller instance.- Parameters:
logger- logger to use in case of exceptions is spawned threads
-
-
Method Details
-
startup
Description copied from interface:IAgentOutputConfigure the agent controller with the supplied options and connect it to the coverage runtime- Specified by:
startupin interfaceIAgentOutput- Parameters:
options- Options used to configure the agent controllerdata- Execution data for this agent- Throws:
IOException
-
shutdown
Description copied from interface:IAgentOutputShutdown the agent controller and clean up any resources it has created.- Specified by:
shutdownin interfaceIAgentOutput- Throws:
Exception- in case shutdown fails
-
writeExecutionData
Description copied from interface:IAgentOutputWrite 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:
writeExecutionDatain interfaceIAgentOutput- Parameters:
reset- iftrueexecution data is cleared afterwards- Throws:
IOException- in case writing fails
-
createServerSocket
Open a server socket based on the given configuration.- Parameters:
options- address and port configuration- Returns:
- opened server socket
- Throws:
IOException
-
getInetAddress
Returns theInetAddressobject to open the server socket on.- Parameters:
address- address specified as a string- Returns:
- address to open the server socket
- Throws:
UnknownHostException
-