@OnWebSocketMessage public void onWebSocketBinary(byte[] message, int offset, int length) { if (this.delegateSession != null) { ByteBuffer buffer = ByteBuffer.wrap(message, offset, length); WebSocketMessage webSocketMessage = toMessage(Type.BINARY, buffer); this.delegateSession.handleMessage(webSocketMessage.getType(), webSocketMessage); } }
@OnWebSocketMessage public void onMessage(Session session, String text) { if (param.onMessage != null) { param.onMessage.callAny(session, text); } }
@OnWebSocketMessage public void onBinaryMessage(Session session, InputStream stream) { if (param.onBinaryMessage != null) { param.onBinaryMessage.callAny(session, stream); } } }
@OnWebSocketMessage public void onWebSocketText(String message) { if (this.delegateSession != null) { WebSocketMessage webSocketMessage = toMessage(Type.TEXT, message); this.delegateSession.handleMessage(webSocketMessage.getType(), webSocketMessage); } }
@OnWebSocketMessage public void onWebSocketBinary(byte[] payload, int offset, int length) { BinaryMessage message = new BinaryMessage(payload, offset, length, true); try { this.webSocketHandler.handleMessage(this.wsSession, message); } catch (Throwable ex) { ExceptionWebSocketHandlerDecorator.tryCloseWithError(this.wsSession, ex, logger); } }
@OnWebSocketMessage public void onWebSocketText(String payload) { TextMessage message = new TextMessage(payload); try { this.webSocketHandler.handleMessage(this.wsSession, message); } catch (Throwable ex) { ExceptionWebSocketHandlerDecorator.tryCloseWithError(this.wsSession, ex, logger); } }
@OnWebSocketMessage public void onMessage(InputStream raw) { final Message msg = MessageEncoding.decodeMessage(raw); LOG.debug("{} message: {}", webSocketSessionHandler.getSessionName(), msg); executor.execute(() -> { try { LOG.debug("Processing message[{}].", msg); process(msg); } catch (InterruptedException e) { LOG.error("Process message[{}] is interruptted.", msg, e); } catch (RuntimeException e) { LOG.error("Unexpected error while processing message[{}]: {}", msg, e.getMessage(), e); } finally { LOG.debug("Finished trying to process message[{}].", msg); } }); }
@OnWebSocketMessage public void onMessage(InputStream input) throws Exception { Message msg = MessageEncoding.decodeMessage(input); LOGGER.debug("{} message: {}", sessionName(), msg); handler.process(this, msg); }
@OnWebSocketMessage public void onMessage(Session session, byte[] buf, int offset, int length) { System.out.printf("Got msg: %s%n", buf); }
@OnWebSocketMessage public void onMessage(byte[] buf, int offset, int length) { send(t -> t.session.getRemote().sendBytesByFuture(ByteBuffer.wrap(buf, offset, length))); }
@OnWebSocketMessage public void onTextMethod(String stanza) { XMPPPacketReader reader = null; try { reader = readerPool.borrowObject(); Document doc = reader.read(new StringReader(stanza)); if (xmppSession == null) { initiateSession(doc.getRootElement()); } else { processStanza(doc.getRootElement()); } } catch (Exception ex) { Log.error("Failed to process XMPP stanza", ex); } finally { if (reader != null) { readerPool.returnObject(reader); } } }
@OnWebSocketMessage public void onMessage(String text) { send(t -> t.session.getRemote().sendStringByFuture(text)); }
@OnWebSocketMessage public void onMessage(String theMsg) { LOG_RECV.info("{}", theMsg); } }
@OnWebSocketMessage public void onMessage(String msg) { try { ObjectNode parse = new ObjectMapper().readValue(msg, ObjectNode.class); if (parse instanceof ObjectNode) { ObjectNode object = (ObjectNode)parse; if (object.has("welcome")) { String token = socketNotificationsClient.getBimServerClient().getToken(); session.getRemote().sendString("{\"token\":\"" + token + "\"}"); } else if (object.has("endpointid")) { socketNotificationsClient.setEndpointId(object.get("endpointid").asLong()); countDownLatch.countDown(); } else { try { socketNotificationsClient.handleIncoming((ObjectNode) object.get("request")); } catch (UserException e) { LOGGER.error("", e); } catch (ConvertException e) { LOGGER.error("", e); } } } } catch (Exception e) { LOGGER.error("", e); } } }
@OnWebSocketMessage public void onMessage(String message) { if (eventProcessor != null) { send(eventProcessor.invoke(connector.hashCode(), this, message)); } }
@OnWebSocketMessage public void onMessage(String msg) { if (log.isDebugEnabled()) log.debug("got message: " + msg); } }
@OnWebSocketMessage public void message(Session session, String message) throws IOException { session.getRemote().sendString(message); } }
@OnWebSocketMessage public void onWebSocketBinary(byte[] payload, int offset, int length) { BinaryMessage message = new BinaryMessage(payload, offset, length, true); try { this.webSocketHandler.handleMessage(this.wsSession, message); } catch (Throwable ex) { ExceptionWebSocketHandlerDecorator.tryCloseWithError(this.wsSession, ex, logger); } }
@OnWebSocketMessage public void onWebSocketText(String payload) { TextMessage message = new TextMessage(payload); try { this.webSocketHandler.handleMessage(this.wsSession, message); } catch (Throwable ex) { ExceptionWebSocketHandlerDecorator.tryCloseWithError(this.wsSession, ex, logger); } }
@OnWebSocketMessage public void onMessage(String msg) throws IOException { SocketMessage message = JSONUtil.mapper().readValue(msg, SocketMessage.class); messages.add(message.getPayload()); messagesArrived.release(); }