aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/TrackerServer.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-15 19:08:58 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-15 19:08:58 -0700
commitca884b765f3f7a642c435be886dbec40f9d1f661 (patch)
treeeb809ffe38faaf6e580fc2434beb9c4e0b3f90e5 /src/main/java/org/traccar/TrackerServer.java
parent63ecf80c11ec9bce19df18fc24ad863a9c2cb212 (diff)
downloadtrackermap-server-ca884b765f3f7a642c435be886dbec40f9d1f661.tar.gz
trackermap-server-ca884b765f3f7a642c435be886dbec40f9d1f661.tar.bz2
trackermap-server-ca884b765f3f7a642c435be886dbec40f9d1f661.zip
Convert some config usages
Diffstat (limited to 'src/main/java/org/traccar/TrackerServer.java')
-rw-r--r--src/main/java/org/traccar/TrackerServer.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/TrackerServer.java b/src/main/java/org/traccar/TrackerServer.java
index b279d3479..dd83ca6b0 100644
--- a/src/main/java/org/traccar/TrackerServer.java
+++ b/src/main/java/org/traccar/TrackerServer.java
@@ -58,11 +58,13 @@ public abstract class TrackerServer implements TrackerConnector {
public TrackerServer(boolean datagram, String protocol) {
this.datagram = datagram;
- secure = Context.getConfig().getBoolean(Keys.PROTOCOL_SSL.withPrefix(protocol));
- address = Context.getConfig().getString(Keys.PROTOCOL_ADDRESS.withPrefix(protocol));
- port = Context.getConfig().getInteger(Keys.PROTOCOL_PORT.withPrefix(protocol));
+ Config config = Context.getConfig();
- BasePipelineFactory pipelineFactory = new BasePipelineFactory(this, protocol) {
+ secure = config.getBoolean(Keys.PROTOCOL_SSL.withPrefix(protocol));
+ address = config.getString(Keys.PROTOCOL_ADDRESS.withPrefix(protocol));
+ port = config.getInteger(Keys.PROTOCOL_PORT.withPrefix(protocol));
+
+ BasePipelineFactory pipelineFactory = new BasePipelineFactory(this, config, protocol) {
@Override
protected void addTransportHandlers(PipelineBuilder pipeline) {
try {
@@ -77,7 +79,7 @@ public abstract class TrackerServer implements TrackerConnector {
@Override
protected void addProtocolHandlers(PipelineBuilder pipeline) {
- TrackerServer.this.addProtocolHandlers(pipeline, Context.getConfig());
+ TrackerServer.this.addProtocolHandlers(pipeline, config);
}
};