aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/schedule
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-04-14 18:03:32 -0700
committerAnton Tananaev <anton@traccar.org>2022-04-14 18:03:32 -0700
commit437a7651096ecdd8e9cabeeca760b9af89b10458 (patch)
tree158176e6025fbf12e28140cc8068fd66055cb1e0 /src/main/java/org/traccar/schedule
parent3241b83dc95fa151ac66dd88c102f08cc7cfaa7a (diff)
downloadtrackermap-server-437a7651096ecdd8e9cabeeca760b9af89b10458.tar.gz
trackermap-server-437a7651096ecdd8e9cabeeca760b9af89b10458.tar.bz2
trackermap-server-437a7651096ecdd8e9cabeeca760b9af89b10458.zip
Refactor services
Diffstat (limited to 'src/main/java/org/traccar/schedule')
-rw-r--r--src/main/java/org/traccar/schedule/ScheduleManager.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/schedule/ScheduleManager.java b/src/main/java/org/traccar/schedule/ScheduleManager.java
index 5d5054100..d43285451 100644
--- a/src/main/java/org/traccar/schedule/ScheduleManager.java
+++ b/src/main/java/org/traccar/schedule/ScheduleManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 - 2021 Anton Tananaev (anton@traccar.org)
+ * Copyright 2020 - 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.
@@ -15,29 +15,29 @@
*/
package org.traccar.schedule;
+import org.traccar.LifecycleObject;
+
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
-public class ScheduleManager {
+public class ScheduleManager implements LifecycleObject {
private ScheduledExecutorService executor;
+ @Override
public void start() {
-
executor = Executors.newSingleThreadScheduledExecutor();
new TaskDeviceInactivityCheck().schedule(executor);
new TaskWebSocketKeepalive().schedule(executor);
-
}
+ @Override
public void stop() {
-
if (executor != null) {
executor.shutdown();
executor = null;
}
-
}
}