aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/ServerManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/ServerManager.java')
-rw-r--r--src/main/java/org/traccar/ServerManager.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/ServerManager.java b/src/main/java/org/traccar/ServerManager.java
index f4f6e1ba4..ffb15d8ca 100644
--- a/src/main/java/org/traccar/ServerManager.java
+++ b/src/main/java/org/traccar/ServerManager.java
@@ -18,6 +18,7 @@ package org.traccar;
import com.google.inject.Injector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.traccar.config.Config;
import org.traccar.config.Keys;
import org.traccar.helper.ClassScanner;
@@ -41,9 +42,10 @@ public class ServerManager implements LifecycleObject {
private final Map<String, BaseProtocol> protocolList = new ConcurrentHashMap<>();
@Inject
- public ServerManager(Injector injector) throws IOException, URISyntaxException, ReflectiveOperationException {
+ public ServerManager(
+ Injector injector, Config config) throws IOException, URISyntaxException, ReflectiveOperationException {
for (Class<?> protocolClass : ClassScanner.findSubclasses(BaseProtocol.class, "org.traccar.protocol")) {
- if (Context.getConfig().hasKey(Keys.PROTOCOL_PORT.withPrefix(BaseProtocol.nameFromClass(protocolClass)))) {
+ if (config.hasKey(Keys.PROTOCOL_PORT.withPrefix(BaseProtocol.nameFromClass(protocolClass)))) {
BaseProtocol protocol = (BaseProtocol) protocolClass.getDeclaredConstructor().newInstance();
injector.injectMembers(protocol);
connectorList.addAll(protocol.getConnectorList());