diff options
author | Anton Tananaev <anton@traccar.org> | 2022-06-09 07:08:39 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-06-09 07:08:39 -0700 |
commit | 4dbe47a2362bde8e2a8419b202a02e5e7fc16f87 (patch) | |
tree | fbc7dbdaa2316562f5aa4eeb0229f407a0d327af /src/main/java/org/traccar/MainModule.java | |
parent | 12fe28bebbdbc61214363a9c7b51bd300ed62c15 (diff) | |
download | trackermap-server-4dbe47a2362bde8e2a8419b202a02e5e7fc16f87.tar.gz trackermap-server-4dbe47a2362bde8e2a8419b202a02e5e7fc16f87.tar.bz2 trackermap-server-4dbe47a2362bde8e2a8419b202a02e5e7fc16f87.zip |
Remove more from context
Diffstat (limited to 'src/main/java/org/traccar/MainModule.java')
-rw-r--r-- | src/main/java/org/traccar/MainModule.java | 11 |
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; + } + } |