use of org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage in project BIMserver by opensourceBIM.
the class WebSocketImpl method onBinary.
@OnWebSocketMessage
public void onBinary(byte[] bytes, int start, int length) {
if (length == 0) {
return;
}
ByteBuffer buffer = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN);
long topicId = buffer.getLong();
BinaryMessageListener binaryMessageListener = binaryMessageListeners.get(topicId);
if (binaryMessageListener != null) {
binaryMessageListener.newData(bytes, start, length);
}
}
use of org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage in project incubator-pulsar by apache.
the class SimpleProducerSocket method onMessage.
@OnWebSocketMessage
public synchronized void onMessage(String msg) throws JsonParseException {
JsonObject ack = new Gson().fromJson(msg, JsonObject.class);
producerBuffer.add(ack.get("messageId").getAsString());
}
use of org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage in project Openfire by igniterealtime.
the class XmppWebSocket method onTextMethod.
@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);
}
}
}
Aggregations