Class TcpConnection
- java.lang.Object
-
- org.jacoco.agent.rt.internal.output.TcpConnection
-
- All Implemented Interfaces:
IRemoteCommandVisitor
class TcpConnection extends java.lang.Object implements IRemoteCommandVisitor
Handler for a single socket based remote connection.
-
-
Field Summary
Fields Modifier and Type Field Description private RuntimeDatadataprivate booleaninitializedprivate RemoteControlReaderreaderprivate java.net.Socketsocketprivate RemoteControlWriterwriter
-
Constructor Summary
Constructors Constructor Description TcpConnection(java.net.Socket socket, RuntimeData data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the underlying socket if not closed yet.voidinit()voidrun()Processes all requests for this session until the socket is closed.voidvisitDumpCommand(boolean dump, boolean reset)Requests a execution data dump with an optional reset.voidwriteExecutionData(boolean reset)Dumps the current execution data if the connection is already initialized and the underlying socket is still open.
-
-
-
Field Detail
-
data
private final RuntimeData data
-
socket
private final java.net.Socket socket
-
writer
private RemoteControlWriter writer
-
reader
private RemoteControlReader reader
-
initialized
private boolean initialized
-
-
Constructor Detail
-
TcpConnection
public TcpConnection(java.net.Socket socket, RuntimeData data)
-
-
Method Detail
-
init
public void init() throws java.io.IOException- Throws:
java.io.IOException
-
run
public void run() throws java.io.IOExceptionProcesses all requests for this session until the socket is closed.- Throws:
java.io.IOException- in case of problems whith the connection
-
writeExecutionData
public void writeExecutionData(boolean reset) throws java.io.IOExceptionDumps the current execution data if the connection is already initialized and the underlying socket is still open.- Parameters:
reset- iftrueexecution data is cleared afterwards- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionCloses the underlying socket if not closed yet.- Throws:
java.io.IOException
-
visitDumpCommand
public void visitDumpCommand(boolean dump, boolean reset) throws java.io.IOExceptionDescription copied from interface:IRemoteCommandVisitorRequests a 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:
java.io.IOException- in case of problems with the remote connection
-
-