refactored ModuleRegistry to singleton system
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -3,6 +3,7 @@ package de.srsoftware.umbrella.time;
|
||||
|
||||
import static de.srsoftware.umbrella.core.ConnectionProvider.connect;
|
||||
import static de.srsoftware.umbrella.core.Constants.*;
|
||||
import static de.srsoftware.umbrella.core.ModuleRegistry.*;
|
||||
import static de.srsoftware.umbrella.core.Paths.*;
|
||||
import static de.srsoftware.umbrella.core.Util.mapValues;
|
||||
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.*;
|
||||
@@ -27,10 +28,11 @@ public class TimeModule extends BaseHandler implements TimeService {
|
||||
|
||||
private final TimeDb timeDb;
|
||||
|
||||
public TimeModule(ModuleRegistry registry, Configuration config) throws UmbrellaException {
|
||||
super(registry);
|
||||
public TimeModule( Configuration config) throws UmbrellaException {
|
||||
super();
|
||||
var dbFile = config.get(CONFIG_DATABASE).orElseThrow(() -> missingFieldException(CONFIG_DATABASE));
|
||||
timeDb = new SqliteDb(connect(dbFile));
|
||||
ModuleRegistry.add(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user