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.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java
index c7359e76c..5a3dca878 100644
--- a/src/org/traccar/Context.java
+++ b/src/org/traccar/Context.java
@@ -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;
@@ -134,13 +136,21 @@ public final class Context {
return eventForwarder;
}
+ private static AliasesManager aliasesManager;
+
+ public static AliasesManager getAliasesManager() {
+ return aliasesManager;
+ }
+
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 +243,8 @@ public final class Context {
eventForwarder = new EventForwarder();
}
+ aliasesManager = new AliasesManager(dataManager);
+
}
public static void init(IdentityManager testIdentityManager) {