6.12.2019

This commit is contained in:
Gregor_Dutzler
2019-12-06 09:24:45 +01:00
parent 87bf1d7291
commit ad62228a29
5 changed files with 33 additions and 35 deletions

View File

@@ -13,39 +13,39 @@ public class main {
Log.setLevel(Log.DEBUG);
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
try {
Thread.sleep(200);
Log.warning("Shutting down ...");
//shutdown routine
} catch (InterruptedException e) {
} catch (InterruptedException e) {
e.printStackTrace();
}
}));
//initial connect to db
//initial connect to db
Log.message("initial login to db");
new Thread(() -> {
try {
JDCB.init("users", "kOpaIJUjkgb9ur6S", "wasteinformation","192.168.65.15",3306);
} catch (IOException e) {
//e.printStackTrace();
Log.error("no connection to db");
}
}).start();
new Thread(() -> {
try {
JDCB.init("users", "kOpaIJUjkgb9ur6S", "wasteinformation", "192.168.65.15", 3306);
} catch (IOException e) {
//e.printStackTrace();
Log.error("no connection to db");
}
}).start();
//startup web server
//startup web server
Thread mythread = new Thread(() -> new Webserver().startserver());
mythread.start();
//startup mqtt service
Log.message("starting mqtt service");
try{
try {
mqtt m = new mqtt();
m.notifymessage();
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}