aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Context.java
diff options
context:
space:
mode:
authorninioe <ninioe@gmail.com>2016-07-19 09:07:23 +0300
committerninioe <ninioe@gmail.com>2016-07-19 09:07:23 +0300
commitef40f3317392068692606b484c6782b95b554cbf (patch)
tree41c48e6c87620a6444aed0ad5706a94e26b1662d /src/org/traccar/Context.java
parent04627d7473e4ea21d6ecd950cbb3fdd6fa249429 (diff)
parentd3e063cf9de8a45bed4dfe87b73aadfd8d2edeab (diff)
downloadtrackermap-server-ef40f3317392068692606b484c6782b95b554cbf.tar.gz
trackermap-server-ef40f3317392068692606b484c6782b95b554cbf.tar.bz2
trackermap-server-ef40f3317392068692606b484c6782b95b554cbf.zip
Merge remote-tracking branch 'refs/remotes/tananaev/master'
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r--src/org/traccar/Context.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java
index 0bb18b675..d32837755 100644
--- a/src/org/traccar/Context.java
+++ b/src/org/traccar/Context.java
@@ -18,6 +18,7 @@ package org.traccar;
import com.ning.http.client.AsyncHttpClient;
import org.traccar.database.ConnectionManager;
import org.traccar.database.DataManager;
+import org.traccar.database.DeviceManager;
import org.traccar.database.IdentityManager;
import org.traccar.database.NotificationManager;
import org.traccar.database.PermissionsManager;
@@ -67,6 +68,12 @@ public final class Context {
return dataManager;
}
+ private static DeviceManager deviceManager;
+
+ public static DeviceManager getDeviceManager() {
+ return deviceManager;
+ }
+
private static ConnectionManager connectionManager;
public static ConnectionManager getConnectionManager() {
@@ -142,7 +149,12 @@ public final class Context {
if (config.hasKey("database.url")) {
dataManager = new DataManager(config);
}
- identityManager = dataManager;
+
+ if (dataManager != null) {
+ deviceManager = new DeviceManager(dataManager);
+ }
+
+ identityManager = deviceManager;
if (config.getBoolean("geocoder.enable")) {
String type = config.getString("geocoder.type", "google");
@@ -205,7 +217,7 @@ public final class Context {
permissionsManager = new PermissionsManager(dataManager);
- connectionManager = new ConnectionManager(dataManager);
+ connectionManager = new ConnectionManager();
if (config.getBoolean("event.geofenceHandler")) {
geofenceManager = new GeofenceManager(dataManager);
@@ -225,7 +237,6 @@ public final class Context {
public static void init(IdentityManager testIdentityManager) {
config = new Config();
- connectionManager = new ConnectionManager(null);
identityManager = testIdentityManager;
}