@Override public void onWebSocketClose(int arg0, String arg1) { try { if (protocolLock.tryLock() || protocolLock.tryLock(ORDERLY_CLOSE_TIMEOUT, TimeUnit.SECONDS)) { LOG.debug("Stomp WebSocket closed: code[{}] message[{}]", arg0, arg1); protocolConverter.onStompCommand(new StompFrame(Stomp.Commands.DISCONNECT)); } } catch (Exception e) { LOG.debug("Failed to close STOMP WebSocket cleanly", e); } finally { if (protocolLock.isHeldByCurrentThread()) { protocolLock.unlock(); } } }
@Override public void onWebSocketClose(int arg0, String arg1) { try { if (protocolLock.tryLock() || protocolLock.tryLock(ORDERLY_CLOSE_TIMEOUT, TimeUnit.SECONDS)) { LOG.debug("Stomp WebSocket closed: code[{}] message[{}]", arg0, arg1); protocolConverter.onStompCommand(new StompFrame(Stomp.Commands.DISCONNECT)); } } catch (Exception e) { LOG.debug("Failed to close STOMP WebSocket cleanly", e); } finally { if (protocolLock.isHeldByCurrentThread()) { protocolLock.unlock(); } } }
@Override public void onWebSocketClose(int arg0, String arg1) { try { if (protocolLock.tryLock() || protocolLock.tryLock(ORDERLY_CLOSE_TIMEOUT, TimeUnit.SECONDS)) { LOG.debug("Stomp WebSocket closed: code[{}] message[{}]", arg0, arg1); protocolConverter.onStompCommand(new StompFrame(Stomp.Commands.DISCONNECT)); } } catch (Exception e) { LOG.debug("Failed to close STOMP WebSocket cleanly", e); } finally { if (protocolLock.isHeldByCurrentThread()) { protocolLock.unlock(); } } }
@Override public void onCommand(Object command) { try { if (trace) { TRACE.trace("Received: \n" + command); } protocolConverter.onStompCommand((StompFrame) command); } catch (IOException e) { onException(e); } catch (JMSException e) { onException(IOExceptionSupport.create(e)); } }
public void onCommand(Object command) { try { if (trace) { LOG.trace("Received: \n" + command); } protocolConverter.onStompCommand((StompFrame)command); } catch (IOException e) { onException(e); } catch (JMSException e) { onException(IOExceptionSupport.create(e)); } }
@Override public void onCommand(Object command) { try { if (trace) { TRACE.trace("Received: \n" + command); } protocolConverter.onStompCommand((StompFrame) command); } catch (IOException e) { onException(e); } catch (JMSException e) { onException(IOExceptionSupport.create(e)); } }
@Override public void onCommand(Object command) { try { if (trace) { TRACE.trace("Received: \n" + command); } protocolConverter.onStompCommand((StompFrame) command); } catch (IOException e) { onException(e); } catch (JMSException e) { onException(IOExceptionSupport.create(e)); } }
@Override public void onMessage(String data) { if (!transportStartedAtLeastOnce()) { LOG.debug("Waiting for StompSocket to be properly started..."); try { socketTransportStarted.await(); } catch (InterruptedException e) { LOG.warn("While waiting for StompSocket to be properly started, we got interrupted!! Should be okay, but you could see race conditions..."); } } try { protocolConverter.onStompCommand((StompFrame)wireFormat.unmarshal(new ByteSequence(data.getBytes("UTF-8")))); } catch (Exception e) { onException(IOExceptionSupport.create(e)); } }
protected void processStompFrame(String data) { if (!transportStartedAtLeastOnce()) { LOG.debug("Waiting for StompSocket to be properly started..."); try { socketTransportStarted.await(); } catch (InterruptedException e) { LOG.warn("While waiting for StompSocket to be properly started, we got interrupted!! Should be okay, but you could see race conditions..."); } } protocolLock.lock(); try { if (data != null) { receiveCounter += data.length(); if (data.equals("\n")) { stompInactivityMonitor.onCommand(new KeepAliveInfo()); } else { StompFrame frame = (StompFrame)wireFormat.unmarshal(new ByteSequence(data.getBytes("UTF-8"))); frame.setTransportContext(getPeerCertificates()); protocolConverter.onStompCommand(frame); } } } catch (Exception e) { onException(IOExceptionSupport.create(e)); } finally { protocolLock.unlock(); } }
protected void processStompFrame(String data) { if (!transportStartedAtLeastOnce()) { LOG.debug("Waiting for StompSocket to be properly started..."); try { socketTransportStarted.await(); } catch (InterruptedException e) { LOG.warn("While waiting for StompSocket to be properly started, we got interrupted!! Should be okay, but you could see race conditions..."); } } protocolLock.lock(); try { if (data != null) { receiveCounter += data.length(); if (data.equals("\n")) { stompInactivityMonitor.onCommand(new KeepAliveInfo()); } else { StompFrame frame = (StompFrame)wireFormat.unmarshal(new ByteSequence(data.getBytes("UTF-8"))); frame.setTransportContext(getPeerCertificates()); protocolConverter.onStompCommand(frame); } } } catch (Exception e) { onException(IOExceptionSupport.create(e)); } finally { protocolLock.unlock(); } }
protected void processStompFrame(String data) { if (!transportStartedAtLeastOnce()) { LOG.debug("Waiting for StompSocket to be properly started..."); try { socketTransportStarted.await(); } catch (InterruptedException e) { LOG.warn("While waiting for StompSocket to be properly started, we got interrupted!! Should be okay, but you could see race conditions..."); } } protocolLock.lock(); try { if (data != null) { receiveCounter += data.length(); if (data.equals("\n")) { stompInactivityMonitor.onCommand(new KeepAliveInfo()); } else { StompFrame frame = (StompFrame)wireFormat.unmarshal(new ByteSequence(data.getBytes("UTF-8"))); frame.setTransportContext(getPeerCertificates()); protocolConverter.onStompCommand(frame); } } } catch (Exception e) { onException(IOExceptionSupport.create(e)); } finally { protocolLock.unlock(); } }