Example usage for org.springframework.web.socket.server HandshakeInterceptor afterHandshake

List of usage examples for org.springframework.web.socket.server HandshakeInterceptor afterHandshake

Introduction

In this page you can find the example usage for org.springframework.web.socket.server HandshakeInterceptor afterHandshake.

Prototype

void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler,
        @Nullable Exception exception);

Source Link

Document

Invoked after the handshake is done.

Usage

From source file:org.springframework.web.socket.server.support.HandshakeInterceptorChain.java

public void applyAfterHandshake(ServerHttpRequest request, ServerHttpResponse response,
        @Nullable Exception failure) {

    for (int i = this.interceptorIndex; i >= 0; i--) {
        HandshakeInterceptor interceptor = this.interceptors.get(i);
        try {/* w  ww . jav a  2  s.co m*/
            interceptor.afterHandshake(request, response, this.wsHandler, failure);
        } catch (Throwable ex) {
            if (logger.isWarnEnabled()) {
                logger.warn(interceptor + " threw exception in afterHandshake: " + ex);
            }
        }
    }
}