aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/MainModule.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-03-07 21:21:22 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-03-07 21:21:22 -0800
commitbf51c1994531da91f364b81d6d8c0778ed9c3570 (patch)
treed39930217931b52a763162dc946c72822a524d9b /src/org/traccar/MainModule.java
parent4e68a40c77240800dce14094b4cc55907410c208 (diff)
downloadtrackermap-server-bf51c1994531da91f364b81d6d8c0778ed9c3570.tar.gz
trackermap-server-bf51c1994531da91f364b81d6d8c0778ed9c3570.tar.bz2
trackermap-server-bf51c1994531da91f364b81d6d8c0778ed9c3570.zip
Refactor overspeed handler
Diffstat (limited to 'src/org/traccar/MainModule.java')
-rw-r--r--src/org/traccar/MainModule.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/org/traccar/MainModule.java b/src/org/traccar/MainModule.java
index cfd280c9f..fe280d7a3 100644
--- a/src/org/traccar/MainModule.java
+++ b/src/org/traccar/MainModule.java
@@ -23,6 +23,8 @@ import org.traccar.config.Config;
import org.traccar.config.Keys;
import org.traccar.database.AttributesManager;
import org.traccar.database.DataManager;
+import org.traccar.database.DeviceManager;
+import org.traccar.database.GeofenceManager;
import org.traccar.database.IdentityManager;
import org.traccar.database.StatisticsManager;
import org.traccar.geocoder.AddressFormat;
@@ -55,6 +57,7 @@ import org.traccar.handler.HemisphereHandler;
import org.traccar.handler.MotionHandler;
import org.traccar.handler.RemoteAddressHandler;
import org.traccar.handler.events.CommandResultEventHandler;
+import org.traccar.handler.events.OverspeedEventHandler;
import org.traccar.reports.model.TripsConfig;
import javax.annotation.Nullable;
@@ -93,6 +96,16 @@ public class MainModule extends AbstractModule {
}
@Provides
+ public static DeviceManager provideDeviceManager() {
+ return Context.getDeviceManager();
+ }
+
+ @Provides
+ public static GeofenceManager provideGeofenceManager() {
+ return Context.getGeofenceManager();
+ }
+
+ @Provides
public static AttributesManager provideAttributesManager() {
return Context.getAttributesManager();
}
@@ -271,6 +284,13 @@ public class MainModule extends AbstractModule {
return new CommandResultEventHandler();
}
+ @Singleton
+ @Provides
+ public static OverspeedEventHandler provideOverspeedEventHandler(
+ Config config, DeviceManager deviceManager, GeofenceManager geofenceManager) {
+ return new OverspeedEventHandler(config, deviceManager, geofenceManager);
+ }
+
@Override
protected void configure() {
binder().requireExplicitBindings();