aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/Context.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-16 06:51:41 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-16 06:51:41 -0700
commitd3fd20d4a4f7dc647e75c5a0cb962759630ed967 (patch)
tree9fada7b5571f61678f7fb5a862be4da0f1f84d12 /src/main/java/org/traccar/Context.java
parent481a902538b951a420d00c32063e0984e4e922d6 (diff)
downloadtrackermap-server-d3fd20d4a4f7dc647e75c5a0cb962759630ed967.tar.gz
trackermap-server-d3fd20d4a4f7dc647e75c5a0cb962759630ed967.tar.bz2
trackermap-server-d3fd20d4a4f7dc647e75c5a0cb962759630ed967.zip
Inject data manager
Diffstat (limited to 'src/main/java/org/traccar/Context.java')
-rw-r--r--src/main/java/org/traccar/Context.java24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/main/java/org/traccar/Context.java b/src/main/java/org/traccar/Context.java
index 00ab05d57..cbbc73d76 100644
--- a/src/main/java/org/traccar/Context.java
+++ b/src/main/java/org/traccar/Context.java
@@ -16,7 +16,6 @@
package org.traccar;
import org.traccar.config.Config;
-import org.traccar.config.Keys;
import org.traccar.database.BaseObjectManager;
import org.traccar.database.DataManager;
import org.traccar.database.DeviceManager;
@@ -47,12 +46,6 @@ public final class Context {
return identityManager;
}
- private static DataManager dataManager;
-
- public static DataManager getDataManager() {
- return dataManager;
- }
-
private static GroupsManager groupsManager;
public static GroupsManager getGroupsManager() {
@@ -82,20 +75,17 @@ public final class Context {
throw e;
}
- if (config.hasKey(Keys.DATABASE_URL)) {
- dataManager = new DataManager(config, Main.getInjector().getInstance(Storage.class));
- }
-
- if (dataManager != null) {
- groupsManager = new GroupsManager(dataManager);
- deviceManager = new DeviceManager(
- config, dataManager, Main.getInjector().getInstance(ConnectionManager.class));
- }
+ groupsManager = new GroupsManager(Main.getInjector().getInstance(DataManager.class));
+ deviceManager = new DeviceManager(
+ config,
+ Main.getInjector().getInstance(DataManager.class),
+ Main.getInjector().getInstance(ConnectionManager.class));
identityManager = deviceManager;
permissionsManager = new PermissionsManager(
- dataManager, Main.getInjector().getInstance(Storage.class));
+ Main.getInjector().getInstance(DataManager.class),
+ Main.getInjector().getInstance(Storage.class));
}