public class DefaultHandshakeHandler extends AbstractHandshakeHandler implements ServletContextAware
HandshakeHandler
implementation.
Performs initial validation of the WebSocket handshake request -- possibly rejecting it
through the appropriate HTTP status code -- while also allowing sub-classes to override
various parts of the negotiation process (e.g. origin validation, sub-protocol negotiation,
extensions negotiation, etc).
If the negotiation succeeds, the actual upgrade is delegated to a server-specific
RequestUpgradeStrategy
, which will update
the response as necessary and initialize the WebSocket. Currently supported servers are
Tomcat 7 and 8, Jetty 9, and GlassFish 4.
logger
Constructor and Description |
---|
DefaultHandshakeHandler() |
DefaultHandshakeHandler(RequestUpgradeStrategy requestUpgradeStrategy) |
Modifier and Type | Method and Description |
---|---|
void |
setServletContext(ServletContext servletContext)
Set the
ServletContext that this object runs in. |
determineHandlerSupportedProtocols, determineUser, doHandshake, doStart, doStop, filterRequestedExtensions, getRequestUpgradeStrategy, getSupportedProtocols, getSupportedVersions, handleInvalidConnectHeader, handleInvalidUpgradeHeader, handleWebSocketVersionNotSupported, isRunning, isValidOrigin, isWebSocketVersionSupported, selectProtocol, setSupportedProtocols, start, stop
public DefaultHandshakeHandler()
public DefaultHandshakeHandler(RequestUpgradeStrategy requestUpgradeStrategy)
public void setServletContext(ServletContext servletContext)
ServletContextAware
ServletContext
that this object runs in.
Invoked after population of normal bean properties but before an init
callback like InitializingBean's afterPropertiesSet
or a
custom init-method. Invoked after ApplicationContextAware's
setApplicationContext
.
setServletContext
in interface ServletContextAware
servletContext
- ServletContext object to be used by this objectInitializingBean.afterPropertiesSet()
,
ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)