aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainModule.java
diff options
context:
space:
mode:
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