Central model instance via singleton

This commit is contained in:
joss 2025-04-25 18:51:25 +02:00
parent ca92fd78c8
commit 1a9aa98c72
2 changed files with 19 additions and 10 deletions

View file

@ -17,13 +17,9 @@ public class Main {
* @param args Die Programmargumente
*/
public static void main(String[] args) {
Model m;
HttpServer s = null;
m = new Model();
m.fillMockData();
/**HttpServer s = null;
Model.getModel().fillMockData();
try {
s = HttpServer.create(new InetSocketAddress("127.0.0.1", 8000), 0);
@ -36,10 +32,10 @@ public class Main {
s.setExecutor(null);
s.start();
} catch (IOException e) {
System.err.println("IOException bei der Erstellung des HTTP Servers. Stack Trace folgt.");
System.err.println("IOException bei der Erstellung des HTTP Servers.");
e.printStackTrace();
return;
}**/
}
// schließen ist nicht nötig, da beim Beenden die ganze JVM zerstört wird
}