рефакторинг. Исправлен баг. если прервать локальную задачу, не удалялся файл interrupt.
This commit is contained in:
2024-01-08 20:37:16 +03:00
parent 5baf2154e2
commit fce61bf55a
26 changed files with 281 additions and 582 deletions

View File

@@ -0,0 +1,34 @@
package Visual_DVM_2021.Passes.SSH;
import GlobalData.Machine.Machine;
import GlobalData.User.User;
import TestingSystem.DVM.UserConnection;
import Visual_DVM_2021.Passes.Pass_2021;
public class ConnectionPass<T> extends Pass_2021<T> {
protected Machine machine = null;
public User user = null;
//--
protected void Connect() throws Exception{
user.connection = null;
user.connection = new UserConnection(machine, user);
System.out.println("Соединение c " + machine.getURL() + " " + user.login + " успешно установлено.");
}
void Disconnect(){
if (user.connection!=null){
user.connection.Disconnect();
user.connection = null;
}
}
@Override
protected void body() throws Exception {
Connect();
ServerAction();
}
@Override
protected void performFinish() throws Exception {
Disconnect();
}
//--
protected void ServerAction() throws Exception{
}
}