aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Main.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-10-16 13:13:01 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-10-16 13:13:01 +1300
commitcaa767f83b9d6107d0bd0c3e8af1dc6304f64daf (patch)
treec0138016eec296faf401e4f1f59c022decab1072 /src/org/traccar/Main.java
parent755f14aa9057144b550889303ce00c1d5b39f0e2 (diff)
downloadtrackermap-server-caa767f83b9d6107d0bd0c3e8af1dc6304f64daf.tar.gz
trackermap-server-caa767f83b9d6107d0bd0c3e8af1dc6304f64daf.tar.bz2
trackermap-server-caa767f83b9d6107d0bd0c3e8af1dc6304f64daf.zip
Add injector to the project
Diffstat (limited to 'src/org/traccar/Main.java')
-rw-r--r--src/org/traccar/Main.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/org/traccar/Main.java b/src/org/traccar/Main.java
index 48f2323ba..c85d93431 100644
--- a/src/org/traccar/Main.java
+++ b/src/org/traccar/Main.java
@@ -15,6 +15,8 @@
*/
package org.traccar;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -34,6 +36,12 @@ public final class Main {
private static final long CLEAN_PERIOD = 24 * 60 * 60 * 1000;
+ private static Injector injector;
+
+ public static Injector getInjector() {
+ return injector;
+ }
+
private Main() {
}
@@ -100,6 +108,7 @@ public final class Main {
public static void run(String configFile) {
try {
Context.init(configFile);
+ injector = Guice.createInjector(new MainModule());
logSystemInfo();
LOGGER.info("Version: " + Context.getAppVersion());
LOGGER.info("Starting server...");