aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/notification
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-09 18:03:52 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-09 18:03:52 -0700
commit336d6c4353fd77ad268aaf5cfe9c0296edfb0201 (patch)
tree1c89b1a3de09c051e305386cf3ba8dbef458cb5a /src/main/java/org/traccar/notification
parentadafc5f6130854dd88c191dd04489073419ee41d (diff)
downloadtrackermap-server-336d6c4353fd77ad268aaf5cfe9c0296edfb0201.tar.gz
trackermap-server-336d6c4353fd77ad268aaf5cfe9c0296edfb0201.tar.bz2
trackermap-server-336d6c4353fd77ad268aaf5cfe9c0296edfb0201.zip
Remove more from context
Diffstat (limited to 'src/main/java/org/traccar/notification')
-rw-r--r--src/main/java/org/traccar/notification/NotificatorManager.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/notification/NotificatorManager.java b/src/main/java/org/traccar/notification/NotificatorManager.java
index 9705377b4..d6ebb2c4a 100644
--- a/src/main/java/org/traccar/notification/NotificatorManager.java
+++ b/src/main/java/org/traccar/notification/NotificatorManager.java
@@ -23,8 +23,8 @@ import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.traccar.Context;
import org.traccar.Main;
+import org.traccar.config.Config;
import org.traccar.config.Keys;
import org.traccar.model.Typed;
import org.traccar.notificators.NotificatorFirebase;
@@ -37,7 +37,11 @@ import org.traccar.notificators.NotificatorWeb;
import org.traccar.notificators.NotificatorTelegram;
import org.traccar.notificators.NotificatorPushover;
-public final class NotificatorManager {
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+@Singleton
+public class NotificatorManager {
private static final Logger LOGGER = LoggerFactory.getLogger(NotificatorManager.class);
@@ -52,8 +56,9 @@ public final class NotificatorManager {
private final Map<String, Notificator> notificators = new HashMap<>();
- public NotificatorManager() {
- String types = Context.getConfig().getString(Keys.NOTIFICATOR_TYPES);
+ @Inject
+ public NotificatorManager(Config config) {
+ String types = config.getString(Keys.NOTIFICATOR_TYPES);
if (types != null) {
for (String type : types.split(",")) {
var notificatorClass = NOTIFICATORS_ALL.get(type);