Commit b5d3ebfb authored by xukaiqiang's avatar xukaiqiang

1

parent bb5ff01f
......@@ -8,9 +8,10 @@ import com.yeejoin.amos.iec104.business.param.AlarmParam;
import com.yeejoin.amos.iec104.business.service.intfc.IClientListenService;
import com.yeejoin.amos.iec104.business.service.intfc.IConfService;
import com.yeejoin.amos.iec104.business.service.intfc.IPointConfigService;
import com.yeejoin.amos.iec104.context.FireAutoIntfContext;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.LinkedList;
......@@ -20,22 +21,31 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@Service
public class GeneralDataQueue {
private static final BlockingQueue<AlarmParam> blockingQueue = new LinkedBlockingQueue<AlarmParam>();
ScheduledExecutorService service_general = null;
IClientListenService clientListenService;
IPointConfigService pointConfigService;
IConfService confService;
private ScheduledExecutorService service_general = null;
@Autowired
private IClientListenService clientListenService;
@Autowired
private IPointConfigService pointConfigService;
@Autowired
private IConfService confService;
private volatile static GeneralDataQueue instance = null;
@Autowired
private RedisTemplate<String, String> redisTemplate;
private GeneralDataQueue() {
clientListenService = (IClientListenService) FireAutoIntfContext.getInstance().getBean(IClientListenService.class);
confService = (IConfService) FireAutoIntfContext.getInstance().getBean(IConfService.class);
pointConfigService = (IPointConfigService) FireAutoIntfContext.getInstance().getBean(IPointConfigService.class);
redisTemplate = (RedisTemplate<String, String>) FireAutoIntfContext.getInstance().getBean(RedisTemplate.class);
}
// private GeneralDataQueue() {
// clientListenService = (IClientListenService) FireAutoIntfContext.getInstance().getBean(IClientListenService.class);
// confService = (IConfService) FireAutoIntfContext.getInstance().getBean(IConfService.class);
// pointConfigService = (IPointConfigService) FireAutoIntfContext.getInstance().getBean(IPointConfigService.class);
// }
public static GeneralDataQueue getInstance() {
//先检查实例是否存在,如果不存在才进入下面的同步块
......
......@@ -15,6 +15,7 @@ import com.yeejoin.amos.iec104.business.service.intfc.IClientListenService;
import com.yeejoin.amos.iec104.business.service.intfc.IConfService;
import com.yeejoin.amos.iec104.business.service.intfc.IPointConfigService;
import com.yeejoin.amos.iec104.context.FireAutoIntfContext;
import org.springframework.stereotype.Service;
public class RecDataQueue {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment