Example usage for org.springframework.web.socket.sockjs.frame SockJsFrame SockJsFrame

List of usage examples for org.springframework.web.socket.sockjs.frame SockJsFrame SockJsFrame

Introduction

In this page you can find the example usage for org.springframework.web.socket.sockjs.frame SockJsFrame SockJsFrame.

Prototype

public SockJsFrame(String content) 

Source Link

Document

Create a new instance frame with the given frame content.

Usage

From source file:org.springframework.web.socket.sockjs.client.AbstractClientSockJsSession.java

public void handleFrame(String payload) {
    SockJsFrame frame = new SockJsFrame(payload);
    switch (frame.getType()) {
    case OPEN://  w  w  w.j  a  v  a 2  s .c  om
        handleOpenFrame();
        break;
    case HEARTBEAT:
        if (logger.isTraceEnabled()) {
            logger.trace("Received heartbeat in " + this);
        }
        break;
    case MESSAGE:
        handleMessageFrame(frame);
        break;
    case CLOSE:
        handleCloseFrame(frame);
    }
}