aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/MainModule.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-03-09 16:11:16 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-03-09 16:11:16 -0800
commitaddbd4b58d959a7996af7631dd3449ac779b027f (patch)
treea1814e463c07a93c359986d1e25db83df2f695b7 /src/org/traccar/MainModule.java
parente3668177e4cb989b596ed7b2eef71eb348860736 (diff)
downloadtrackermap-server-addbd4b58d959a7996af7631dd3449ac779b027f.tar.gz
trackermap-server-addbd4b58d959a7996af7631dd3449ac779b027f.tar.bz2
trackermap-server-addbd4b58d959a7996af7631dd3449ac779b027f.zip
Refactor geofence event handler
Diffstat (limited to 'src/org/traccar/MainModule.java')
-rw-r--r--src/org/traccar/MainModule.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/org/traccar/MainModule.java b/src/org/traccar/MainModule.java
index 10d35f72f..fd49fe3b5 100644
--- a/src/org/traccar/MainModule.java
+++ b/src/org/traccar/MainModule.java
@@ -22,6 +22,7 @@ import com.google.inject.Singleton;
import org.traccar.config.Config;
import org.traccar.config.Keys;
import org.traccar.database.AttributesManager;
+import org.traccar.database.CalendarManager;
import org.traccar.database.DataManager;
import org.traccar.database.DeviceManager;
import org.traccar.database.GeofenceManager;
@@ -58,6 +59,7 @@ import org.traccar.handler.MotionHandler;
import org.traccar.handler.RemoteAddressHandler;
import org.traccar.handler.events.CommandResultEventHandler;
import org.traccar.handler.events.FuelDropEventHandler;
+import org.traccar.handler.events.GeofenceEventHandler;
import org.traccar.handler.events.MotionEventHandler;
import org.traccar.handler.events.OverspeedEventHandler;
import org.traccar.reports.model.TripsConfig;
@@ -108,6 +110,11 @@ public class MainModule extends AbstractModule {
}
@Provides
+ public static CalendarManager provideCalendarManager() {
+ return Context.getCalendarManager();
+ }
+
+ @Provides
public static AttributesManager provideAttributesManager() {
return Context.getAttributesManager();
}
@@ -306,6 +313,13 @@ public class MainModule extends AbstractModule {
return new MotionEventHandler(identityManager, deviceManager, tripsConfig);
}
+ @Singleton
+ @Provides
+ public static GeofenceEventHandler provideGeofenceEventHandler(
+ IdentityManager identityManager, GeofenceManager geofenceManager, CalendarManager calendarManager) {
+ return new GeofenceEventHandler(identityManager, geofenceManager, calendarManager);
+ }
+
@Override
protected void configure() {
binder().requireExplicitBindings();