if (frame instanceof TextFrame) {
logger.trace("WebSocket.onReceivedFrame (TextFrame)");
webSocketProcessor.invokeWebSocketProtocol(webSocket, ((TextFrame) frame).getText());
} else if (frame instanceof BinaryFrame) {
logger.trace("WebSocket.onReceivedFrame (BinaryFrame)");
BinaryFrame binaryFrame = (BinaryFrame) frame;
webSocketProcessor.invokeWebSocketProtocol(webSocket, binaryFrame.getByteArray(), 0,
binaryFrame.getByteArray().length);
} else if (frame instanceof CloseFrame) {
// TODO shall we call this here?
logger.trace("WebSocket.onReceivedFrame (CloseFrame)");
webSocketProcessor.close(webSocket, 1005);
} else {