aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/WebDataHandler.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-18 14:36:31 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-18 14:36:31 -0700
commite665a2c7f4dd925bed116961da48bb018d6f57f7 (patch)
treee22e63d11900006234503cbdf0a2016b94a7278f /src/main/java/org/traccar/WebDataHandler.java
parent367c6266918a9f21ec6a9eabd091b00016c1d1bf (diff)
downloadtrackermap-server-e665a2c7f4dd925bed116961da48bb018d6f57f7.tar.gz
trackermap-server-e665a2c7f4dd925bed116961da48bb018d6f57f7.tar.bz2
trackermap-server-e665a2c7f4dd925bed116961da48bb018d6f57f7.zip
Remove static injector usages
Diffstat (limited to 'src/main/java/org/traccar/WebDataHandler.java')
-rw-r--r--src/main/java/org/traccar/WebDataHandler.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/WebDataHandler.java b/src/main/java/org/traccar/WebDataHandler.java
index 192a15bcf..d25c4fd3c 100644
--- a/src/main/java/org/traccar/WebDataHandler.java
+++ b/src/main/java/org/traccar/WebDataHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 - 2020 Anton Tananaev (anton@traccar.org)
+ * Copyright 2015 - 2022 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -63,6 +63,7 @@ public class WebDataHandler extends BaseDataHandler {
private final CacheManager cacheManager;
private final ObjectMapper objectMapper;
private final Client client;
+ private final Timer timer;
private final String url;
private final String header;
@@ -78,11 +79,12 @@ public class WebDataHandler extends BaseDataHandler {
@Inject
public WebDataHandler(
- Config config, CacheManager cacheManager, ObjectMapper objectMapper, Client client) {
+ Config config, CacheManager cacheManager, ObjectMapper objectMapper, Client client, Timer timer) {
this.cacheManager = cacheManager;
this.objectMapper = objectMapper;
this.client = client;
+ this.timer = timer;
this.url = config.getString(Keys.FORWARD_URL);
this.header = config.getString(Keys.FORWARD_HEADER);
this.json = config.getBoolean(Keys.FORWARD_JSON);
@@ -248,8 +250,7 @@ public class WebDataHandler extends BaseDataHandler {
}
private void schedule() {
- Main.getInjector().getInstance(Timer.class).newTimeout(
- this, retryDelay * (long) Math.pow(2, retries++), TimeUnit.MILLISECONDS);
+ timer.newTimeout(this, retryDelay * (long) Math.pow(2, retries++), TimeUnit.MILLISECONDS);
}
@Override