Deprecated as of 5.0 a TaskScheduler is not provided upfront, not until it is obvious that it is needed, see AbstractWebSocketHandlerRegistration.getSockJsServiceRegistration().
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 public SockJsServiceRegistration withSockJS() { this.sockJsServiceRegistration = new SockJsServiceRegistration(); HandshakeInterceptor[] interceptors = getInterceptors(); if (interceptors.length > 0) { this.sockJsServiceRegistration.setInterceptors(interceptors); } if (this.handshakeHandler != null) { WebSocketTransportHandler transportHandler = new WebSocketTransportHandler(this.handshakeHandler); this.sockJsServiceRegistration.setTransportHandlerOverrides(transportHandler); } if (!this.allowedOrigins.isEmpty()) { this.sockJsServiceRegistration.setAllowedOrigins(StringUtils.toStringArray(this.allowedOrigins)); } return this.sockJsServiceRegistration; }
@Override public SockJsServiceRegistration withSockJS() { this.sockJsServiceRegistration = new SockJsServiceRegistration(); HandshakeInterceptor[] interceptors = getInterceptors(); if (interceptors.length > 0) { this.sockJsServiceRegistration.setInterceptors(interceptors); } if (this.handshakeHandler != null) { WebSocketTransportHandler transportHandler = new WebSocketTransportHandler(this.handshakeHandler); this.sockJsServiceRegistration.setTransportHandlerOverrides(transportHandler); } if (!this.allowedOrigins.isEmpty()) { this.sockJsServiceRegistration.setAllowedOrigins(StringUtils.toStringArray(this.allowedOrigins)); } return this.sockJsServiceRegistration; }
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 public SockJsServiceRegistration withSockJS() { this.sockJsServiceRegistration = new SockJsServiceRegistration(); if (this.scheduler != null) { this.sockJsServiceRegistration.setTaskScheduler(this.scheduler); } HandshakeInterceptor[] interceptors = getInterceptors(); if (interceptors.length > 0) { this.sockJsServiceRegistration.setInterceptors(interceptors); } if (this.handshakeHandler != null) { WebSocketTransportHandler transportHandler = new WebSocketTransportHandler(this.handshakeHandler); this.sockJsServiceRegistration.setTransportHandlerOverrides(transportHandler); } if (!this.allowedOrigins.isEmpty()) { this.sockJsServiceRegistration.setAllowedOrigins(StringUtils.toStringArray(this.allowedOrigins)); } return this.sockJsServiceRegistration; }
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; }