aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/database/MailManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-18 14:36:31 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-18 14:36:31 -0700
commite665a2c7f4dd925bed116961da48bb018d6f57f7 (patch)
treee22e63d11900006234503cbdf0a2016b94a7278f /src/main/java/org/traccar/database/MailManager.java
parent367c6266918a9f21ec6a9eabd091b00016c1d1bf (diff)
downloadtrackermap-server-e665a2c7f4dd925bed116961da48bb018d6f57f7.tar.gz
trackermap-server-e665a2c7f4dd925bed116961da48bb018d6f57f7.tar.bz2
trackermap-server-e665a2c7f4dd925bed116961da48bb018d6f57f7.zip
Remove static injector usages
Diffstat (limited to 'src/main/java/org/traccar/database/MailManager.java')
-rw-r--r--src/main/java/org/traccar/database/MailManager.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/database/MailManager.java b/src/main/java/org/traccar/database/MailManager.java
index 54f617d5f..ac0db2d97 100644
--- a/src/main/java/org/traccar/database/MailManager.java
+++ b/src/main/java/org/traccar/database/MailManager.java
@@ -18,7 +18,6 @@ package org.traccar.database;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.traccar.Main;
import org.traccar.config.Config;
import org.traccar.model.User;
import org.traccar.notification.PropertiesProvider;
@@ -42,10 +41,12 @@ public final class MailManager {
private static final Logger LOGGER = LoggerFactory.getLogger(MailManager.class);
private final Config config;
+ private final StatisticsManager statisticsManager;
@Inject
- public MailManager(Config config) {
+ public MailManager(Config config, StatisticsManager statisticsManager) {
this.config = config;
+ this.statisticsManager = statisticsManager;
}
private static Properties getProperties(PropertiesProvider provider) {
@@ -145,7 +146,7 @@ public final class MailManager {
}
try (Transport transport = session.getTransport()) {
- Main.getInjector().getInstance(StatisticsManager.class).registerMail();
+ statisticsManager.registerMail();
transport.connect(
properties.getProperty("mail.smtp.host"),
properties.getProperty("mail.smtp.username"),