aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainEventHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/MainEventHandler.java')
-rw-r--r--src/main/java/org/traccar/MainEventHandler.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/MainEventHandler.java b/src/main/java/org/traccar/MainEventHandler.java
index 52eb43faf..17bcad0dd 100644
--- a/src/main/java/org/traccar/MainEventHandler.java
+++ b/src/main/java/org/traccar/MainEventHandler.java
@@ -16,6 +16,7 @@
package org.traccar;
import io.netty.channel.Channel;
+import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.socket.DatagramChannel;
@@ -23,7 +24,6 @@ import io.netty.handler.codec.http.HttpRequestDecoder;
import io.netty.handler.timeout.IdleStateEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.traccar.broadcast.BroadcastService;
import org.traccar.config.Config;
import org.traccar.config.Keys;
import org.traccar.database.StatisticsManager;
@@ -41,11 +41,14 @@ import org.traccar.storage.query.Condition;
import org.traccar.storage.query.Request;
import javax.inject.Inject;
+import javax.inject.Singleton;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
+@Singleton
+@ChannelHandler.Sharable
public class MainEventHandler extends ChannelInboundHandlerAdapter {
private static final Logger LOGGER = LoggerFactory.getLogger(MainEventHandler.class);
@@ -57,17 +60,15 @@ public class MainEventHandler extends ChannelInboundHandlerAdapter {
private final Storage storage;
private final ConnectionManager connectionManager;
private final StatisticsManager statisticsManager;
- private final BroadcastService broadcastService;
@Inject
public MainEventHandler(
Config config, CacheManager cacheManager, Storage storage, ConnectionManager connectionManager,
- StatisticsManager statisticsManager, BroadcastService broadcastService) {
+ StatisticsManager statisticsManager) {
this.cacheManager = cacheManager;
this.storage = storage;
this.connectionManager = connectionManager;
this.statisticsManager = statisticsManager;
- this.broadcastService = broadcastService;
String connectionlessProtocolList = config.getString(Keys.STATUS_IGNORE_OFFLINE);
if (connectionlessProtocolList != null) {
connectionlessProtocols.addAll(Arrays.asList(connectionlessProtocolList.split("[, ]")));