diff options
Diffstat (limited to 'src/main/java/org/traccar/Context.java')
-rw-r--r-- | src/main/java/org/traccar/Context.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/Context.java b/src/main/java/org/traccar/Context.java index aeba9c4c9..c44d432b2 100644 --- a/src/main/java/org/traccar/Context.java +++ b/src/main/java/org/traccar/Context.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr353.JSR353Module; import org.apache.velocity.app.VelocityEngine; import org.eclipse.jetty.util.URIUtil; +import org.traccar.broadcast.BroadcastService; import org.traccar.config.Config; import org.traccar.config.Keys; import org.traccar.database.AttributesManager; @@ -171,6 +172,12 @@ public final class Context { return scheduleManager; } + private static BroadcastService broadcastService; + + public static BroadcastService getBroadcastService() { + return broadcastService; + } + private static GeofenceManager geofenceManager; public static GeofenceManager getGeofenceManager() { @@ -335,6 +342,10 @@ public final class Context { serverManager = new ServerManager(); scheduleManager = new ScheduleManager(); + if (config.hasKey(Keys.BROADCAST_ADDRESS)) { + broadcastService = new BroadcastService(config, objectMapper); + } + if (config.hasKey(Keys.EVENT_FORWARD_URL)) { eventForwarder = new EventForwarder(); } |