Only enable Tomcat's websocket support on Java7+

Tomcat's websocket support requires Java7 or later. That commit makes
sure to register its support only when such requirement is met.

Closes gh-4846
1.2.x
Stephane Nicoll 9 years ago
parent 835a11b52a
commit 12cefd2c2b

@ -24,6 +24,7 @@ import org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainer
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnJava;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
@ -61,6 +62,7 @@ public class WebSocketAutoConfiguration {
@Bean
@ConditionalOnMissingBean(name = "websocketContainerCustomizer")
@ConditionalOnJava(ConditionalOnJava.JavaVersion.SEVEN)
public EmbeddedServletContainerCustomizer websocketContainerCustomizer() {
return new TomcatWebSocketContainerCustomizer();
}

Loading…
Cancel
Save