Class ExecDumpClient
java.lang.Object
org.jacoco.core.tools.ExecDumpClient
A client for remote execution data dumps.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate intprivate long -
Constructor Summary
ConstructorsConstructorDescriptionNew instance with the defaultsdump==true,reset==false,retryCount==0andretryDelay=1000. -
Method Summary
Modifier and TypeMethodDescriptionRequests a dump from the given end-point.dump(InetAddress address, int port) Requests a dump from the given end-point.protected voidonConnecting(InetAddress address, int port) This method can be overwritten to get an event just before a connection is made.protected voidonConnectionFailure(IOException exception) This method can be overwritten to get an event for connection failures when another retry will be attempted.voidsetDump(boolean dump) Specifies whether a dump should be requestedvoidsetReset(boolean reset) Specifies whether execution data should be reset.voidsetRetryCount(int retryCount) Sets the number of retry attempts to connect to the target socket.voidsetRetryDelay(long retryDelay) Sets the delay time before between connection attempts.private voidsleep()private SockettryConnect(InetAddress address, int port)
-
Field Details
-
dump
private boolean dump -
reset
private boolean reset -
retryCount
private int retryCount -
retryDelay
private long retryDelay
-
-
Constructor Details
-
ExecDumpClient
public ExecDumpClient()New instance with the defaultsdump==true,reset==false,retryCount==0andretryDelay=1000.
-
-
Method Details
-
setDump
public void setDump(boolean dump) Specifies whether a dump should be requested- Parameters:
dump-trueif a dump should be requested
-
setReset
public void setReset(boolean reset) Specifies whether execution data should be reset.- Parameters:
reset-trueif execution data should be reset
-
setRetryCount
public void setRetryCount(int retryCount) Sets the number of retry attempts to connect to the target socket. This allows to wait for a certain time until the target agent has initialized.- Parameters:
retryCount- number of retries
-
setRetryDelay
public void setRetryDelay(long retryDelay) Sets the delay time before between connection attempts.- Parameters:
retryDelay- delay in milliseconds
-
dump
Requests a dump from the given end-point.- Parameters:
address- IP-Address to connect toport- port to connect to- Returns:
- container for the dumped data
- Throws:
IOException- in case the dump can not be requested
-
dump
Requests a dump from the given end-point.- Parameters:
address- host name or IP-Address to connect toport- port to connect to- Returns:
- container for the dumped data
- Throws:
IOException- in case the dump can not be requested
-
tryConnect
- Throws:
IOException
-
sleep
- Throws:
InterruptedIOException
-
onConnecting
This method can be overwritten to get an event just before a connection is made.- Parameters:
address- target addressport- target port
-
onConnectionFailure
This method can be overwritten to get an event for connection failures when another retry will be attempted.- Parameters:
exception- connection error
-