| | |
| | | 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; |
| | | } |
| | | } |
| | | |