| | |
| | | public class RecordInfoResponseMessageHandler extends SIPRequestProcessorParent implements InitializingBean, IMessageHandler { |
| | | |
| | | private Logger logger = LoggerFactory.getLogger(RecordInfoResponseMessageHandler.class); |
| | | public static volatile List<String> threadNameList = new ArrayList(); |
| | | private final String cmdType = "RecordInfo"; |
| | | private final static String CACHE_RECORDINFO_KEY = "CACHE_RECORDINFO_"; |
| | | |
| | | private ConcurrentLinkedQueue<HandlerCatchData> taskQueue = new ConcurrentLinkedQueue<>(); |
| | | |
| | |
| | | if (!taskQueueHandlerRun) { |
| | | taskQueueHandlerRun = true; |
| | | taskExecutor.execute(()->{ |
| | | try { |
| | | while (!taskQueue.isEmpty()) { |
| | | while (!taskQueue.isEmpty()) { |
| | | try { |
| | | HandlerCatchData take = taskQueue.poll(); |
| | | Element rootElementForCharset = getRootElement(take.getEvt(), take.getDevice().getCharset()); |
| | | String sn = getText(rootElementForCharset, "SN"); |
| | |
| | | releaseRequest(take.getDevice().getDeviceId(), sn); |
| | | } |
| | | } |
| | | } catch (DocumentException e) { |
| | | throw new RuntimeException(e); |
| | | } finally { |
| | | taskQueueHandlerRun = false; |
| | | } |
| | | taskQueueHandlerRun = false; |
| | | }catch (DocumentException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | }); |
| | | } |
| | |
| | | e.printStackTrace(); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | }finally { |
| | | taskQueueHandlerRun = false; |
| | | } |
| | | } |
| | | |