diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-08-27 23:45:17 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-08-27 23:45:17 -0700 |
commit | 27004f3b9c32ebf3a9f99fa2388ebcbd3fcfb5de (patch) | |
tree | 4599b7b83a9fd83b8fe0f1cb6afbf4f5fbc24dda /src/main/java/org/traccar/schedule/ScheduleManager.java | |
parent | 6c3c6c5ead98e38b152685dd3528c0f70cdcac50 (diff) | |
download | trackermap-server-27004f3b9c32ebf3a9f99fa2388ebcbd3fcfb5de.tar.gz trackermap-server-27004f3b9c32ebf3a9f99fa2388ebcbd3fcfb5de.tar.bz2 trackermap-server-27004f3b9c32ebf3a9f99fa2388ebcbd3fcfb5de.zip |
Add device inactivity event
Diffstat (limited to 'src/main/java/org/traccar/schedule/ScheduleManager.java')
-rw-r--r-- | src/main/java/org/traccar/schedule/ScheduleManager.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/schedule/ScheduleManager.java b/src/main/java/org/traccar/schedule/ScheduleManager.java new file mode 100644 index 000000000..3f19d6152 --- /dev/null +++ b/src/main/java/org/traccar/schedule/ScheduleManager.java @@ -0,0 +1,27 @@ +package org.traccar.schedule; + +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; + +public class ScheduleManager { + + private ScheduledExecutorService executor; + + public void start() { + + executor = Executors.newSingleThreadScheduledExecutor(); + + new TaskDeviceInactivityCheck().schedule(executor); + + } + + public void stop() { + + if (executor != null) { + executor.shutdown(); + executor = null; + } + + } + +} |