aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/notification
diff options
context:
space:
mode:
authorIvan Martinez <ivanfmartinez@users.noreply.github.com>2018-06-01 09:48:07 -0300
committerIvan Martinez <ivanfmartinez@users.noreply.github.com>2018-06-01 09:48:07 -0300
commit4fc750b585dd6b2953b16408dd57a8ef93fdeee9 (patch)
tree8697ae3559ad7b5e4e9b667a6d2faef568769b1a /src/org/traccar/notification
parent8ca7b2d0d9b5e18dd7e96a2cf5b1b8d8d751051a (diff)
downloadtrackermap-server-4fc750b585dd6b2953b16408dd57a8ef93fdeee9.tar.gz
trackermap-server-4fc750b585dd6b2953b16408dd57a8ef93fdeee9.tar.bz2
trackermap-server-4fc750b585dd6b2953b16408dd57a8ef93fdeee9.zip
move NotificatorManager instance to Context
Diffstat (limited to 'src/org/traccar/notification')
-rw-r--r--src/org/traccar/notification/NotificatorManager.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/org/traccar/notification/NotificatorManager.java b/src/org/traccar/notification/NotificatorManager.java
index 0ffef5d05..c58149847 100644
--- a/src/org/traccar/notification/NotificatorManager.java
+++ b/src/org/traccar/notification/NotificatorManager.java
@@ -26,9 +26,7 @@ import org.traccar.helper.Log;
public final class NotificatorManager {
- private static final NotificatorManager INSTANCE = new NotificatorManager();
-
- private NotificatorManager() {
+ public NotificatorManager() {
final String[] types = Context.getConfig().getString("notificator.types", "").split(",");
for (String type : types) {
final String className = Context.getConfig().getString("notificator." + type + ".class", "");
@@ -53,8 +51,8 @@ public final class NotificatorManager {
private final Map<String, Notificator> notificators = new HashMap<>();
private static final Notificator NULL_NOTIFICATOR = new NotificationNull();
- public static Notificator getNotificator(String type) {
- final Notificator n = INSTANCE.notificators.get(type);
+ public Notificator getNotificator(String type) {
+ final Notificator n = notificators.get(type);
if (n == null) {
Log.error("No notificator configured for type : " + type);
return NULL_NOTIFICATOR;
@@ -62,11 +60,11 @@ public final class NotificatorManager {
return n;
}
- public static Notificator getSms() {
+ public Notificator getSms() {
return getNotificator("sms");
}
- public static Notificator getMail() {
+ public Notificator getMail() {
return getNotificator("mail");
}