public class SockJsHttpRequestHandler extends Object implements org.springframework.web.HttpRequestHandler, org.springframework.web.cors.CorsConfigurationSource, org.springframework.context.Lifecycle, org.springframework.web.context.ServletContextAware
HttpRequestHandler
that allows mapping a SockJsService
to requests
in a Servlet container.Constructor and Description |
---|
SockJsHttpRequestHandler(SockJsService sockJsService,
WebSocketHandler webSocketHandler)
Create a new SockJsHttpRequestHandler.
|
Modifier and Type | Method and Description |
---|---|
org.springframework.web.cors.CorsConfiguration |
getCorsConfiguration(HttpServletRequest request) |
SockJsService |
getSockJsService()
Return the
SockJsService . |
WebSocketHandler |
getWebSocketHandler()
Return the
WebSocketHandler . |
void |
handleRequest(HttpServletRequest servletRequest,
HttpServletResponse servletResponse) |
boolean |
isRunning() |
void |
setServletContext(ServletContext servletContext) |
void |
start() |
void |
stop() |
public SockJsHttpRequestHandler(SockJsService sockJsService, WebSocketHandler webSocketHandler)
sockJsService
- the SockJS servicewebSocketHandler
- the websocket handlerpublic SockJsService getSockJsService()
SockJsService
.public WebSocketHandler getWebSocketHandler()
WebSocketHandler
.public void setServletContext(ServletContext servletContext)
setServletContext
in interface org.springframework.web.context.ServletContextAware
public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public void handleRequest(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException
handleRequest
in interface org.springframework.web.HttpRequestHandler
ServletException
IOException
public org.springframework.web.cors.CorsConfiguration getCorsConfiguration(HttpServletRequest request)
getCorsConfiguration
in interface org.springframework.web.cors.CorsConfigurationSource