refactored ModuleRegistry to singleton system
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -5,6 +5,7 @@ import static de.srsoftware.tools.Optionals.is0;
|
||||
import static de.srsoftware.tools.Optionals.isSet;
|
||||
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.ResponseCode.HTTP_NOT_IMPLEMENTED;
|
||||
import static de.srsoftware.umbrella.core.Util.mapValues;
|
||||
@@ -37,10 +38,11 @@ public class TaskModule extends BaseHandler implements TaskService {
|
||||
|
||||
private final TaskDb taskDb;
|
||||
|
||||
public TaskModule(ModuleRegistry registry, Configuration config) throws UmbrellaException {
|
||||
super(registry);
|
||||
public TaskModule(Configuration config) throws UmbrellaException {
|
||||
super();
|
||||
var dbFile = config.get(CONFIG_DATABASE).orElseThrow(() -> missingFieldException(CONFIG_DATABASE));
|
||||
taskDb = new SqliteDb(connect(dbFile));
|
||||
ModuleRegistry.add(this);
|
||||
}
|
||||
|
||||
private void addMember(Task task, long userId) {
|
||||
|
||||
Reference in New Issue
Block a user