diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketNamespaceUtils.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketNamespaceUtils.java index 92e7044ba9d..e0c24e14594 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketNamespaceUtils.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketNamespaceUtils.java @@ -32,6 +32,8 @@ import org.springframework.web.socket.sockjs.transport.TransportHandlingSockJsSe import org.springframework.web.socket.sockjs.transport.handler.DefaultSockJsService; import org.springframework.web.socket.sockjs.transport.handler.WebSocketTransportHandler; +import java.util.concurrent.ScheduledThreadPoolExecutor; + /** * Provides utility methods for parsing common WebSocket XML namespace elements. * @@ -43,7 +45,7 @@ class WebSocketNamespaceUtils { // Check for setRemoveOnCancelPolicy method - available on JDK 7 and higher private static boolean hasRemoveOnCancelPolicyMethod = ClassUtils.hasMethod( - WebSocketNamespaceUtils.class, "setRemoveOnCancelPolicy", boolean.class); + ScheduledThreadPoolExecutor.class, "setRemoveOnCancelPolicy", boolean.class); public static RuntimeBeanReference registerHandshakeHandler(Element element, ParserContext parserContext, Object source) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketConfigurationSupport.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketConfigurationSupport.java index 9e873eb0f0d..0e8a2f652dd 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketConfigurationSupport.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketConfigurationSupport.java @@ -22,6 +22,8 @@ import org.springframework.util.ClassUtils; import org.springframework.web.servlet.HandlerMapping; import org.springframework.web.servlet.handler.AbstractHandlerMapping; +import java.util.concurrent.ScheduledThreadPoolExecutor; + /** * Configuration support for WebSocket request handling. * @@ -32,7 +34,7 @@ public class WebSocketConfigurationSupport { // Check for setRemoveOnCancelPolicy method - available on JDK 7 and higher private static boolean hasRemoveOnCancelPolicyMethod = ClassUtils.hasMethod( - WebSocketConfigurationSupport.class, "setRemoveOnCancelPolicy", boolean.class); + ScheduledThreadPoolExecutor.class, "setRemoveOnCancelPolicy", boolean.class); @Bean diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java index 52178f6389b..7dfc81adc37 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java @@ -26,6 +26,8 @@ import org.springframework.web.servlet.HandlerMapping; import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.messaging.SubProtocolWebSocketHandler; +import java.util.concurrent.ScheduledThreadPoolExecutor; + /** * Extends {@link AbstractMessageBrokerConfiguration} and adds configuration for * receiving and responding to STOMP messages from WebSocket clients. @@ -41,7 +43,7 @@ public abstract class WebSocketMessageBrokerConfigurationSupport extends Abstrac // Check for setRemoveOnCancelPolicy method - available on JDK 7 and higher private static boolean hasRemoveOnCancelPolicyMethod = ClassUtils.hasMethod( - WebSocketConfigurationSupport.class, "setRemoveOnCancelPolicy", boolean.class); + ScheduledThreadPoolExecutor.class, "setRemoveOnCancelPolicy", boolean.class); private WebSocketTransportRegistration transportRegistration;