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.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/MainModule.java b/src/main/java/org/traccar/MainModule.java
index bb264cff3..c9f2d4e62 100644
--- a/src/main/java/org/traccar/MainModule.java
+++ b/src/main/java/org/traccar/MainModule.java
@@ -21,6 +21,7 @@ import com.google.inject.Provides;
import com.google.inject.Scopes;
import io.netty.util.HashedWheelTimer;
import io.netty.util.Timer;
+import org.traccar.broadcast.BroadcastService;
import org.traccar.config.Config;
import org.traccar.config.Keys;
import org.traccar.database.LdapProvider;
@@ -65,6 +66,7 @@ import org.traccar.storage.Storage;
import javax.annotation.Nullable;
import javax.inject.Singleton;
import javax.ws.rs.client.Client;
+import java.io.IOException;
public class MainModule extends AbstractModule {
@@ -247,4 +249,13 @@ public class MainModule extends AbstractModule {
return null;
}
+ @Provides
+ public static BroadcastService provideBroadcastService(
+ Config config, ObjectMapper objectMapper) throws IOException {
+ if (config.hasKey(Keys.BROADCAST_ADDRESS)) {
+ return new BroadcastService(config, objectMapper);
+ }
+ return null;
+ }
+
}