aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-04 06:50:50 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-04 06:50:50 -0700
commitea22ffb859f8bb8fa0a468af192fef395653d645 (patch)
tree959ceef93b645ae1573de1cf0eba86b657dec92c /src/main/java/org/traccar/api
parentec76482c15094a7e04964c67d3011a7e8e1ad6a9 (diff)
downloadtrackermap-server-ea22ffb859f8bb8fa0a468af192fef395653d645.tar.gz
trackermap-server-ea22ffb859f8bb8fa0a468af192fef395653d645.tar.bz2
trackermap-server-ea22ffb859f8bb8fa0a468af192fef395653d645.zip
Remove more from context
Diffstat (limited to 'src/main/java/org/traccar/api')
-rw-r--r--src/main/java/org/traccar/api/resource/CommandResource.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/api/resource/CommandResource.java b/src/main/java/org/traccar/api/resource/CommandResource.java
index 17bb150f6..60f1f8eb0 100644
--- a/src/main/java/org/traccar/api/resource/CommandResource.java
+++ b/src/main/java/org/traccar/api/resource/CommandResource.java
@@ -20,7 +20,7 @@ package org.traccar.api.resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.traccar.BaseProtocol;
-import org.traccar.Context;
+import org.traccar.ServerManager;
import org.traccar.api.ExtendedObjectResource;
import org.traccar.database.CommandsManager;
import org.traccar.model.Command;
@@ -60,6 +60,9 @@ public class CommandResource extends ExtendedObjectResource<Command> {
@Inject
private CommandsManager commandsManager;
+ @Inject
+ private ServerManager serverManager;
+
public CommandResource() {
super(Command.class);
}
@@ -68,7 +71,7 @@ public class CommandResource extends ExtendedObjectResource<Command> {
Position position = storage.getObject(Position.class, new Request(
new Columns.All(), new Condition.LatestPositions(deviceId)));
if (position != null) {
- return Context.getServerManager().getProtocol(position.getProtocol());
+ return serverManager.getProtocol(position.getProtocol());
} else {
return null;
}