no message
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
package _VisualDVM.Repository;
|
||||
import Common.Database.Database;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Utils.InterruptThread;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Database;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Utils.InterruptThread;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.Repository.Server.DiagnosticSignalHandler;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
|
||||
import _VisualDVM.Utils;
|
||||
import javafx.util.Pair;
|
||||
import sun.misc.SignalHandler;
|
||||
|
||||
@@ -28,48 +28,32 @@ import java.util.LinkedHashMap;
|
||||
import java.util.Properties;
|
||||
import java.util.Vector;
|
||||
public abstract class RepositoryServer<D extends Database> {
|
||||
Class<D> d_class;
|
||||
public final static String separator = "----------------------------------";
|
||||
protected static FileWriter Log;
|
||||
protected static boolean printOn = false;
|
||||
//-
|
||||
public D db;
|
||||
protected Socket clientSocket; //сокет для общения
|
||||
protected ServerSocket server; // серверсокет
|
||||
protected ObjectInputStream in; // поток чтения из сокета
|
||||
protected ObjectOutputStream out; // поток записи в сокет
|
||||
//-
|
||||
public D db;
|
||||
protected static FileWriter Log;
|
||||
protected ServerExchangeUnit_2021 request;
|
||||
protected ServerExchangeUnit_2021 response;
|
||||
//-
|
||||
protected ServerCode code;
|
||||
protected long count = 0; //для отладки.
|
||||
protected static boolean printOn = false;
|
||||
//-----------
|
||||
SignalHandler signalHandler = signal -> {
|
||||
};
|
||||
//------------
|
||||
public abstract int getPort();
|
||||
protected abstract void Session() throws Exception;
|
||||
protected void startAdditionalThreads() {
|
||||
}
|
||||
public final static String separator = "----------------------------------";
|
||||
public RepositoryServer(Class<D> d_class_in) {
|
||||
d_class = d_class_in;
|
||||
}
|
||||
public void ActivateDB() {
|
||||
try {
|
||||
db = d_class.newInstance();
|
||||
db.Connect();
|
||||
db.CreateAllTables();
|
||||
db.prepareTablesStatements();
|
||||
db.Synchronize();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
protected Thread interruptThread = new InterruptThread(10000,
|
||||
() -> {
|
||||
System.exit(0);
|
||||
return null;
|
||||
});
|
||||
Class<D> d_class;
|
||||
//-----------
|
||||
SignalHandler signalHandler = signal -> {
|
||||
};
|
||||
public RepositoryServer(Class<D> d_class_in) {
|
||||
d_class = d_class_in;
|
||||
}
|
||||
protected static void Print(String message) {
|
||||
if (printOn) {
|
||||
try {
|
||||
@@ -83,6 +67,22 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------
|
||||
public abstract int getPort();
|
||||
protected abstract void Session() throws Exception;
|
||||
protected void startAdditionalThreads() {
|
||||
}
|
||||
public void ActivateDB() {
|
||||
try {
|
||||
db = d_class.newInstance();
|
||||
db.Connect();
|
||||
db.CreateAllTables();
|
||||
db.prepareTablesStatements();
|
||||
db.Synchronize();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
protected void checkTargets(EmailMessage message_in) {
|
||||
}
|
||||
public void Email(EmailMessage message_in, File... directAttachements) throws Exception {
|
||||
@@ -117,7 +117,6 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
Constants.MailPassword);
|
||||
}
|
||||
});
|
||||
|
||||
for (String target : targets_) {
|
||||
boolean done = false;
|
||||
int attempts = 5;
|
||||
|
||||
Reference in New Issue
Block a user