|
|
|
@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.PreDestroy;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Iterator;
|
|
|
|
@ -32,7 +33,13 @@ public class MntnCheckTask {
|
|
|
|
|
@Autowired
|
|
|
|
|
private CacheService cacheService;
|
|
|
|
|
|
|
|
|
|
StringBuilder sb;
|
|
|
|
|
private StringBuilder sb;
|
|
|
|
|
private int shutdown = 0;
|
|
|
|
|
|
|
|
|
|
@PreDestroy
|
|
|
|
|
private void preDestroy() {
|
|
|
|
|
shutdown = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Scheduled(initialDelay = 60000, fixedDelay = 60000)
|
|
|
|
|
private void checkAll() {
|
|
|
|
@ -41,7 +48,7 @@ public class MntnCheckTask {
|
|
|
|
|
sb = new StringBuilder();
|
|
|
|
|
Map<Integer, Terminals> terminalMap = cacheService.getTerminalMap();
|
|
|
|
|
Iterator<Integer> it = terminalMap.keySet().iterator();
|
|
|
|
|
while (it.hasNext()) {
|
|
|
|
|
while (shutdown == 0 && it.hasNext()) {
|
|
|
|
|
Integer termId = it.next();
|
|
|
|
|
this.checkOne(termId);
|
|
|
|
|
}
|
|
|
|
|