aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api/resource
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/api/resource')
-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;
}