Class DefaultHandshakeHandler
java.lang.Object
org.springframework.web.socket.server.support.AbstractHandshakeHandler
org.springframework.web.socket.server.support.DefaultHandshakeHandler
- All Implemented Interfaces:
Aware, Lifecycle, ServletContextAware, HandshakeHandler
public class DefaultHandshakeHandler
extends AbstractHandshakeHandler
implements ServletContextAware
A default
HandshakeHandler implementation,
extending AbstractHandshakeHandler with Servlet-specific initialization support.
As of 7.0, this class prefers JettyRequestUpgradeStrategy when Jetty WebSocket
is available on the classpath, using StandardWebSocketUpgradeStrategy otherwise.- Since:
- 4.0
- Author:
- Rossen Stoyanchev, Juergen Hoeller
-
Field Summary
Fields inherited from class AbstractHandshakeHandler
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetServletContext(jakarta.servlet.ServletContext servletContext) Set theServletContextthat this object runs in.Methods inherited from class AbstractHandshakeHandler
determineHandlerSupportedProtocols, determineUser, doHandshake, doStart, doStop, filterRequestedExtensions, getRequestUpgradeStrategy, getSupportedProtocols, getSupportedVersions, handleInvalidConnectHeader, handleInvalidUpgradeHeader, handleWebSocketVersionNotSupported, isRunning, isValidOrigin, isWebSocketVersionSupported, selectProtocol, setSupportedProtocols, start, stop
-
Constructor Details
-
DefaultHandshakeHandler
public DefaultHandshakeHandler() -
DefaultHandshakeHandler
-
-
Method Details
-
setServletContext
public void setServletContext(jakarta.servlet.ServletContext servletContext) Description copied from interface:ServletContextAwareSet theServletContextthat this object runs in.Invoked after population of normal bean properties but before an init callback like InitializingBean's
afterPropertiesSetor a custom init-method. Invoked after ApplicationContextAware'ssetApplicationContext.- Specified by:
setServletContextin interfaceServletContextAware- Parameters:
servletContext- the ServletContext object to be used by this object- See Also:
-