Example usage for org.springframework.web.socket.sockjs SockJsMessageDeliveryException SockJsMessageDeliveryException

List of usage examples for org.springframework.web.socket.sockjs SockJsMessageDeliveryException SockJsMessageDeliveryException

Introduction

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

Prototype

public SockJsMessageDeliveryException(String sessionId, List<String> undeliveredMessages, String message) 

Source Link

Usage

From source file:org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.java

public void delegateMessages(String... messages) throws SockJsMessageDeliveryException {
    List<String> undelivered = new ArrayList<>(Arrays.asList(messages));
    for (String message : messages) {
        try {/*from   ww  w . j  a v  a  2s  .c o m*/
            if (isClosed()) {
                throw new SockJsMessageDeliveryException(this.id, undelivered, "Session closed");
            } else {
                this.handler.handleMessage(this, new TextMessage(message));
                undelivered.remove(0);
            }
        } catch (Throwable ex) {
            throw new SockJsMessageDeliveryException(this.id, undelivered, ex);
        }
    }
}