aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Context.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r--src/org/traccar/Context.java27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java
index c7359e76c..581f00082 100644
--- a/src/org/traccar/Context.java
+++ b/src/org/traccar/Context.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
package org.traccar;
import com.ning.http.client.AsyncHttpClient;
+
+import org.traccar.database.AliasesManager;
import org.traccar.database.ConnectionManager;
import org.traccar.database.DataManager;
import org.traccar.database.DeviceManager;
@@ -23,6 +25,7 @@ import org.traccar.database.IdentityManager;
import org.traccar.database.NotificationManager;
import org.traccar.database.PermissionsManager;
import org.traccar.database.GeofenceManager;
+import org.traccar.database.StatisticsManager;
import org.traccar.geocode.BingMapsReverseGeocoder;
import org.traccar.geocode.FactualReverseGeocoder;
import org.traccar.geocode.GeocodeFarmReverseGeocoder;
@@ -134,13 +137,27 @@ public final class Context {
return eventForwarder;
}
+ private static AliasesManager aliasesManager;
+
+ public static AliasesManager getAliasesManager() {
+ return aliasesManager;
+ }
+
+ private static StatisticsManager statisticsManager;
+
+ public static StatisticsManager getStatisticsManager() {
+ return statisticsManager;
+ }
+
public static void init(String[] arguments) throws Exception {
config = new Config();
- if (arguments.length > 0) {
- config.load(arguments[0]);
+ if (arguments.length <= 0) {
+ throw new RuntimeException("Configuration file is not provided");
}
+ config.load(arguments[0]);
+
loggerEnabled = config.getBoolean("logger.enable");
if (loggerEnabled) {
Log.setupLogger(config);
@@ -233,6 +250,10 @@ public final class Context {
eventForwarder = new EventForwarder();
}
+ aliasesManager = new AliasesManager(dataManager);
+
+ statisticsManager = new StatisticsManager();
+
}
public static void init(IdentityManager testIdentityManager) {