diff options
author | Anton Tananaev <anton@traccar.org> | 2022-06-18 14:36:31 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-06-18 14:36:31 -0700 |
commit | e665a2c7f4dd925bed116961da48bb018d6f57f7 (patch) | |
tree | e22e63d11900006234503cbdf0a2016b94a7278f /src/main/java/org/traccar/api | |
parent | 367c6266918a9f21ec6a9eabd091b00016c1d1bf (diff) | |
download | trackermap-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/api')
-rw-r--r-- | src/main/java/org/traccar/api/resource/DeviceResource.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/api/resource/DeviceResource.java b/src/main/java/org/traccar/api/resource/DeviceResource.java index 2509c9003..6660752d3 100644 --- a/src/main/java/org/traccar/api/resource/DeviceResource.java +++ b/src/main/java/org/traccar/api/resource/DeviceResource.java @@ -28,6 +28,7 @@ import org.traccar.storage.query.Columns; import org.traccar.storage.query.Condition; import org.traccar.storage.query.Request; +import javax.inject.Inject; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.PUT; @@ -45,6 +46,9 @@ import java.util.List; @Consumes(MediaType.APPLICATION_JSON) public class DeviceResource extends BaseObjectResource<Device> { + @Inject + private CacheManager cacheManager; + public DeviceResource() { super(Device.class); } @@ -122,7 +126,7 @@ public class DeviceResource extends BaseObjectResource<Device> { new Columns.Include("positionId"), new Condition.Equals("id", "id"))); - Main.getInjector().getInstance(CacheManager.class).updatePosition(position); + cacheManager.updatePosition(position); } else { throw new IllegalArgumentException(); } |