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.project;
|
||||
|
||||
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.LIST;
|
||||
import static de.srsoftware.umbrella.core.Paths.SEARCH;
|
||||
import static de.srsoftware.umbrella.core.Util.mapValues;
|
||||
@@ -32,10 +33,11 @@ public class ProjectModule extends BaseHandler implements ProjectService {
|
||||
|
||||
private final ProjectDb projectDb;
|
||||
|
||||
public ProjectModule(ModuleRegistry registry, Configuration config) throws UmbrellaException {
|
||||
super(registry);
|
||||
public ProjectModule(Configuration config) throws UmbrellaException {
|
||||
super();
|
||||
var dbFile = config.get(CONFIG_DATABASE).orElseThrow(() -> missingFieldException(CONFIG_DATABASE));
|
||||
projectDb = new SqliteDb(connect(dbFile));
|
||||
ModuleRegistry.add(this);
|
||||
}
|
||||
|
||||
private void addMember(Project project, long userId) {
|
||||
|
||||
Reference in New Issue
Block a user