ThreadMonotor.java
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.bsth.data;
import com.bsth.data.gpsdata.arrival.GpsRealAnalyse;
import com.bsth.data.gpsdata.thread.GpsDataLoaderThread;
import com.bsth.data.msg_queue.DirectivePushQueue;
import com.bsth.data.msg_queue.WebSocketPushQueue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
/**
* Created by panzhao on 2017/5/11.
*/
@Component
public class ThreadMonotor extends Thread{
Logger log = LoggerFactory.getLogger(this.getClass());
@Override
public void run() {
//线调GPS分析主线程
if(GpsRealAnalyse.isBlock()){
log.warn("GpsRealAnalyse isBlock true !!!!");
GpsRealAnalyse.shutdown();
}
if(GpsRealAnalyse.isIdle()){
//切换到备用的网关实时GPS对照数据
GpsDataLoaderThread.setFlag(-1);
}
//webSocket 消息推送队列
if(WebSocketPushQueue.isIdle()){
log.warn("WebSocketPushQueue isIdle true !!!!");
WebSocketPushQueue.start();
}
//网关指令推送队列(系统自动发送的)
if(DirectivePushQueue.isIdle()){
log.warn("DirectivePushQueue isIdle true !!!!");
DirectivePushQueue.start();
}
}
}