aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r--src/org/traccar/ServerManager.java15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 17c572ae3..cdc679e8a 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -70,10 +70,11 @@ public class ServerManager {
for (String name : names) {
Class protocolClass = Class.forName(packageName + '.' + name);
- if (BaseProtocol.class.isAssignableFrom(protocolClass)) {
- BaseProtocol baseProtocol = (BaseProtocol) protocolClass.newInstance();
- initProtocolServer(baseProtocol);
- protocolList.put(baseProtocol.getName(), baseProtocol);
+ if (BaseProtocol.class.isAssignableFrom(protocolClass)
+ && Context.getConfig().hasKey(BaseProtocol.nameFromClass(protocolClass) + ".port")) {
+ BaseProtocol protocol = (BaseProtocol) protocolClass.newInstance();
+ serverList.addAll(protocol.getServerList());
+ protocolList.put(protocol.getName(), protocol);
}
}
}
@@ -99,10 +100,4 @@ public class ServerManager {
GlobalTimer.release();
}
- private void initProtocolServer(final Protocol protocol) {
- if (Context.getConfig().hasKey(protocol.getName() + ".port")) {
- protocol.initTrackerServers(serverList);
- }
- }
-
}