aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainModule.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-25 13:33:35 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-25 13:33:35 -0700
commitc53d98c668af9c79767e22964f05c7bf7dc866f2 (patch)
tree42d664009487232e3a21514bb5ab52c7571262a6 /src/main/java/org/traccar/MainModule.java
parent5a732a26c85785a9b801583f2fff0ce47314aa03 (diff)
downloadtrackermap-server-c53d98c668af9c79767e22964f05c7bf7dc866f2.tar.gz
trackermap-server-c53d98c668af9c79767e22964f05c7bf7dc866f2.tar.bz2
trackermap-server-c53d98c668af9c79767e22964f05c7bf7dc866f2.zip
Integrate broadcast service
Diffstat (limited to 'src/main/java/org/traccar/MainModule.java')
-rw-r--r--src/main/java/org/traccar/MainModule.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/MainModule.java b/src/main/java/org/traccar/MainModule.java
index 5a5675859..f60d41d62 100644
--- a/src/main/java/org/traccar/MainModule.java
+++ b/src/main/java/org/traccar/MainModule.java
@@ -29,6 +29,8 @@ import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.runtime.log.NullLogChute;
import org.eclipse.jetty.util.URIUtil;
import org.traccar.broadcast.BroadcastService;
+import org.traccar.broadcast.MulticastBroadcastService;
+import org.traccar.broadcast.NullBroadcastService;
import org.traccar.config.Config;
import org.traccar.config.Keys;
import org.traccar.database.LdapProvider;
@@ -278,13 +280,14 @@ public class MainModule extends AbstractModule {
return null;
}
+ @Singleton
@Provides
public static BroadcastService provideBroadcastService(
Config config, ObjectMapper objectMapper) throws IOException {
if (config.hasKey(Keys.BROADCAST_ADDRESS)) {
- return new BroadcastService(config, objectMapper);
+ return new MulticastBroadcastService(config, objectMapper);
}
- return null;
+ return new NullBroadcastService();
}
@Provides