Deprecated as of 5.0 a TaskScheduler is not provided upfront, not until it is obvious that it is needed; call SockJsServiceRegistration.getTaskScheduler() to check and then SockJsServiceRegistration.setTaskScheduler(TaskScheduler) to set it before a call to SockJsServiceRegistration.createSockJsService()
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; }
protected final M getMappings() { M mappings = createMappings(); if (this.sockJsServiceRegistration != null) { SockJsService sockJsService = this.sockJsServiceRegistration.getSockJsService(); this.handlerMap.forEach((wsHandler, paths) -> { for (String path : paths) { String pathPattern = (path.endsWith("/") ? path + "**" : path + "/**"); addSockJsServiceMapping(mappings, sockJsService, wsHandler, pathPattern); } }); } else { HandshakeHandler handshakeHandler = getOrCreateHandshakeHandler(); HandshakeInterceptor[] interceptors = getInterceptors(); this.handlerMap.forEach((wsHandler, paths) -> { for (String path : paths) { addWebSocketHandlerMapping(mappings, wsHandler, handshakeHandler, interceptors, path); } }); } return mappings; }
@Override protected SockJsService getSockJsService() { return super.getSockJsService(); }
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; }
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; }
protected final M getMappings() { M mappings = createMappings(); if (this.sockJsServiceRegistration != null) { SockJsService sockJsService = this.sockJsServiceRegistration.getSockJsService(); this.handlerMap.forEach((wsHandler, paths) -> { for (String path : paths) { String pathPattern = (path.endsWith("/") ? path + "**" : path + "/**"); addSockJsServiceMapping(mappings, sockJsService, wsHandler, pathPattern); } }); } else { HandshakeHandler handshakeHandler = getOrCreateHandshakeHandler(); HandshakeInterceptor[] interceptors = getInterceptors(); this.handlerMap.forEach((wsHandler, paths) -> { for (String path : paths) { addWebSocketHandlerMapping(mappings, wsHandler, handshakeHandler, interceptors, path); } }); } return mappings; }
protected final M getMappings() { M mappings = createMappings(); if (this.sockJsServiceRegistration != null) { SockJsService sockJsService = this.sockJsServiceRegistration.getSockJsService(); this.handlerMap.forEach((wsHandler, paths) -> { for (String path : paths) { String pathPattern = (path.endsWith("/") ? path + "**" : path + "/**"); addSockJsServiceMapping(mappings, sockJsService, wsHandler, pathPattern); } }); } else { HandshakeHandler handshakeHandler = getOrCreateHandshakeHandler(); HandshakeInterceptor[] interceptors = getInterceptors(); this.handlerMap.forEach((wsHandler, paths) -> { for (String path : paths) { addWebSocketHandlerMapping(mappings, wsHandler, handshakeHandler, interceptors, path); } }); } return mappings; }