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 RuntimeData
data
private boolean
initialized
private RemoteControlReader
reader
private java.net.Socket
socket
private RemoteControlWriter
writer
-
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 void
close()
Closes the underlying socket if not closed yet.void
init()
void
run()
Processes all requests for this session until the socket is closed.void
visitDumpCommand(boolean dump, boolean reset)
Requests a execution data dump with an optional reset.void
writeExecutionData(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.IOException
Processes 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.IOException
Dumps the current execution data if the connection is already initialized and the underlying socket is still open.- Parameters:
reset
- iftrue
execution data is cleared afterwards- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
Closes the underlying socket if not closed yet.- Throws:
java.io.IOException
-
visitDumpCommand
public void visitDumpCommand(boolean dump, boolean reset) throws java.io.IOException
Description copied from interface:IRemoteCommandVisitor
Requests a execution data dump with an optional reset.- Specified by:
visitDumpCommand
in interfaceIRemoteCommandVisitor
- Parameters:
dump
-true
if the dump should be executedreset
-true
if the reset should be executed- Throws:
java.io.IOException
- in case of problems with the remote connection
-
-