aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-12-28 21:45:05 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2020-12-28 21:45:05 -0800
commit4f3d413a3003d7b9295c2e6801e7f3033738f65e (patch)
tree6b512462ec636b49e4001ab5017e8d1eb3f1535f /src/main/java/org/traccar/ServerManager.java
parent51704590a835057bf4850a5eaf8c5037d20f648a (diff)
downloadtrackermap-server-4f3d413a3003d7b9295c2e6801e7f3033738f65e.tar.gz
trackermap-server-4f3d413a3003d7b9295c2e6801e7f3033738f65e.tar.bz2
trackermap-server-4f3d413a3003d7b9295c2e6801e7f3033738f65e.zip
Migrate more keys
Diffstat (limited to 'src/main/java/org/traccar/ServerManager.java')
-rw-r--r--src/main/java/org/traccar/ServerManager.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/ServerManager.java b/src/main/java/org/traccar/ServerManager.java
index 68b133c98..935a821aa 100644
--- a/src/main/java/org/traccar/ServerManager.java
+++ b/src/main/java/org/traccar/ServerManager.java
@@ -17,6 +17,7 @@ package org.traccar;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.traccar.config.Keys;
import java.io.File;
import java.io.IOException;
@@ -70,10 +71,10 @@ public class ServerManager {
}
for (String name : names) {
- Class protocolClass = Class.forName(packageName + '.' + name);
- if (BaseProtocol.class.isAssignableFrom(protocolClass)
- && Context.getConfig().hasKey(BaseProtocol.nameFromClass(protocolClass) + ".port")) {
- BaseProtocol protocol = (BaseProtocol) protocolClass.newInstance();
+ Class<?> protocolClass = Class.forName(packageName + '.' + name);
+ if (BaseProtocol.class.isAssignableFrom(protocolClass) && Context.getConfig().hasKey(
+ Keys.PROTOCOL_PORT.withPrefix(BaseProtocol.nameFromClass(protocolClass)))) {
+ BaseProtocol protocol = (BaseProtocol) protocolClass.getDeclaredConstructor().newInstance();
serverList.addAll(protocol.getServerList());
protocolList.put(protocol.getName(), protocol);
}