no message

This commit is contained in:
2024-10-14 12:14:01 +03:00
parent 3a29898d5f
commit 452c4c7268
466 changed files with 1255 additions and 1100 deletions

View File

@@ -0,0 +1,36 @@
package _VisualDVM.Passes.All;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
import _VisualDVM.Passes.Server.TestingSystemPass;
import java.net.ConnectException;
public class PingTestingServer extends TestingSystemPass {
boolean flag;
boolean silent;
@Override
protected boolean canStart(Object... args) throws Exception {
flag = false;
silent = args.length > 0 ? (boolean) args[0] : false;
return super.canStart(args);
}
@Override
protected void ServerAction() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.Ping));
flag = true;
}
@Override
protected boolean validate() {
return flag;
}
@Override
protected void CheckException(Exception ex) {
if (silent) {
Throwable cause = getCauseRec(ex);
if ((cause instanceof ConnectException) && cause.getMessage().contains("Connection refused: connect")) {
//так как это пинг, игнорируем.
return;
}
}
super.CheckException(ex);
}
}