use of org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler in project spring-framework by spring-projects.
the class ServletWebSocketHandlerRegistration method addSockJsServiceMapping.
@Override
protected void addSockJsServiceMapping(MultiValueMap<HttpRequestHandler, String> mappings, SockJsService sockJsService, WebSocketHandler handler, String pathPattern) {
SockJsHttpRequestHandler httpHandler = new SockJsHttpRequestHandler(sockJsService, handler);
mappings.add(httpHandler, pathPattern);
}
use of org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler in project spring-framework by spring-projects.
the class WebMvcStompWebSocketEndpointRegistration method getMappings.
public final MultiValueMap<HttpRequestHandler, String> getMappings() {
MultiValueMap<HttpRequestHandler, String> mappings = new LinkedMultiValueMap<>();
if (this.registration != null) {
SockJsService sockJsService = this.registration.getSockJsService();
for (String path : this.paths) {
String pattern = (path.endsWith("/") ? path + "**" : path + "/**");
SockJsHttpRequestHandler handler = new SockJsHttpRequestHandler(sockJsService, this.webSocketHandler);
mappings.add(handler, pattern);
}
} else {
for (String path : this.paths) {
WebSocketHttpRequestHandler handler;
if (this.handshakeHandler != null) {
handler = new WebSocketHttpRequestHandler(this.webSocketHandler, this.handshakeHandler);
} else {
handler = new WebSocketHttpRequestHandler(this.webSocketHandler);
}
HandshakeInterceptor[] interceptors = getInterceptors();
if (interceptors.length > 0) {
handler.setHandshakeInterceptors(Arrays.asList(interceptors));
}
mappings.add(handler, path);
}
}
return mappings;
}
Aggregations