refactored ModuleRegistry to singleton system
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -10,7 +10,6 @@ import de.srsoftware.configuration.JsonConfig;
|
||||
import de.srsoftware.tools.ColorLogger;
|
||||
import de.srsoftware.umbrella.bookmarks.BookmarkApi;
|
||||
import de.srsoftware.umbrella.company.CompanyModule;
|
||||
import de.srsoftware.umbrella.core.ModuleRegistry;
|
||||
import de.srsoftware.umbrella.core.Util;
|
||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
||||
import de.srsoftware.umbrella.documents.DocumentApi;
|
||||
@@ -59,26 +58,25 @@ public class Application {
|
||||
|
||||
var server = HttpServer.create(new InetSocketAddress(port), 0);
|
||||
|
||||
var registry = new ModuleRegistry();
|
||||
new Translations(registry).bindPath("/api/translations").on(server);
|
||||
new MessageSystem(registry,config);
|
||||
new UserModule(registry,config).bindPath("/api/user").on(server);
|
||||
new TagModule(registry,config).bindPath("/api/tags").on(server);
|
||||
new BookmarkApi(registry,config).bindPath("/api/bookmark").on(server);
|
||||
new CompanyModule(registry, config).bindPath("/api/company").on(server);
|
||||
new CompanyLegacy(registry, config).bindPath("/legacy/company").on(server);
|
||||
new DocumentApi(registry, config).bindPath("/api/document").on(server);
|
||||
new ItemApi(registry, config).bindPath("/api/items").on(server);
|
||||
new UserLegacy(registry,config).bindPath("/legacy/user").on(server);
|
||||
new NotesLegacy(registry,config).bindPath("/legacy/notes").on(server);
|
||||
new MarkdownApi(registry).bindPath("/api/markdown").on(server);
|
||||
new NoteModule(registry,config).bindPath("/api/notes").on(server);
|
||||
new ProjectModule(registry, config).bindPath("/api/project").on(server);
|
||||
new ProjectLegacy(registry,config).bindPath("/legacy/project").on(server);
|
||||
new TaskModule(registry, config).bindPath("/api/task").on(server);
|
||||
new TaskLegacy(registry, config).bindPath("/legacy/task").on(server);
|
||||
new TimeModule(registry, config).bindPath("/api/time").on(server);
|
||||
new WebHandler(registry).bindPath("/").on(server);
|
||||
new Translations().bindPath("/api/translations").on(server);
|
||||
new MessageSystem(config);
|
||||
new UserModule(config).bindPath("/api/user").on(server);
|
||||
new TagModule(config).bindPath("/api/tags").on(server);
|
||||
new BookmarkApi(config).bindPath("/api/bookmark").on(server);
|
||||
new CompanyModule(config).bindPath("/api/company").on(server);
|
||||
new CompanyLegacy(config).bindPath("/legacy/company").on(server);
|
||||
new DocumentApi(config).bindPath("/api/document").on(server);
|
||||
new ItemApi(config).bindPath("/api/items").on(server);
|
||||
new UserLegacy(config).bindPath("/legacy/user").on(server);
|
||||
new NotesLegacy(config).bindPath("/legacy/notes").on(server);
|
||||
new MarkdownApi().bindPath("/api/markdown").on(server);
|
||||
new NoteModule(config).bindPath("/api/notes").on(server);
|
||||
new ProjectModule(config).bindPath("/api/project").on(server);
|
||||
new ProjectLegacy(config).bindPath("/legacy/project").on(server);
|
||||
new TaskModule(config).bindPath("/api/task").on(server);
|
||||
new TaskLegacy().bindPath("/legacy/task").on(server);
|
||||
new TimeModule(config).bindPath("/api/time").on(server);
|
||||
new WebHandler().bindPath("/").on(server);
|
||||
|
||||
server.setExecutor(Executors.newFixedThreadPool(threads));
|
||||
server.start();
|
||||
|
||||
Reference in New Issue
Block a user