use of org.springframework.web.socket.config.annotation.SockJsServiceRegistration in project spring-integration by spring-projects.
the class ServerWebSocketContainer method registerWebSocketHandlers.
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
WebSocketHandler webSocketHandler = this.webSocketHandler;
if (this.decoratorFactories != null) {
for (WebSocketHandlerDecoratorFactory factory : this.decoratorFactories) {
webSocketHandler = factory.decorate(webSocketHandler);
}
}
WebSocketHandlerRegistration registration = registry.addHandler(webSocketHandler, this.paths).setHandshakeHandler(this.handshakeHandler).addInterceptors(this.interceptors).setAllowedOrigins(this.origins);
if (this.sockJsServiceOptions != null) {
SockJsServiceRegistration sockJsServiceRegistration = registration.withSockJS();
if (this.sockJsServiceOptions.webSocketEnabled != null) {
sockJsServiceRegistration.setWebSocketEnabled(this.sockJsServiceOptions.webSocketEnabled);
}
if (this.sockJsServiceOptions.clientLibraryUrl != null) {
sockJsServiceRegistration.setClientLibraryUrl(this.sockJsServiceOptions.clientLibraryUrl);
}
if (this.sockJsServiceOptions.disconnectDelay != null) {
sockJsServiceRegistration.setDisconnectDelay(this.sockJsServiceOptions.disconnectDelay);
}
if (this.sockJsServiceOptions.heartbeatTime != null) {
sockJsServiceRegistration.setHeartbeatTime(this.sockJsServiceOptions.heartbeatTime);
}
if (this.sockJsServiceOptions.httpMessageCacheSize != null) {
sockJsServiceRegistration.setHttpMessageCacheSize(this.sockJsServiceOptions.httpMessageCacheSize);
}
if (this.sockJsServiceOptions.heartbeatTime != null) {
sockJsServiceRegistration.setHeartbeatTime(this.sockJsServiceOptions.heartbeatTime);
}
if (this.sockJsServiceOptions.sessionCookieNeeded != null) {
sockJsServiceRegistration.setSessionCookieNeeded(this.sockJsServiceOptions.sessionCookieNeeded);
}
if (this.sockJsServiceOptions.streamBytesLimit != null) {
sockJsServiceRegistration.setStreamBytesLimit(this.sockJsServiceOptions.streamBytesLimit);
}
if (this.sockJsServiceOptions.transportHandlers != null) {
sockJsServiceRegistration.setTransportHandlers(this.sockJsServiceOptions.transportHandlers);
}
if (this.sockJsServiceOptions.taskScheduler != null) {
sockJsServiceRegistration.setTaskScheduler(this.sockJsServiceOptions.taskScheduler);
}
if (this.sockJsServiceOptions.messageCodec != null) {
sockJsServiceRegistration.setMessageCodec(this.sockJsServiceOptions.messageCodec);
}
if (this.sockJsServiceOptions.suppressCors != null) {
sockJsServiceRegistration.setSupressCors(this.sockJsServiceOptions.suppressCors);
}
}
}
Aggregations