TransportHandler. Uses SockJsWebSocketHandler and
WebSocketServerSockJsSession to add SockJS processing.
Also implements HandshakeHandler to support raw WebSocket communication at
SockJS URL "/websocket".
| Modifier and Type | Field and Description |
|---|---|
| private final HandshakeHandler | |
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | checkSessionType(SockJsSession session)
Implements org. Check whether the type of the given session matches the transport type
of this |
| public AbstractSockJsSession | createSession(String
the ID of the session id, WebSocketHandler the underlying handler, Map<String, Object> WebSocketHandlerhandshake request specific attributes attrs)Implements org. Create a new SockJS session. |
| public boolean | doHandshake(ServerHttpRequest
the current request request, ServerHttpResponse the current response response, WebSocketHandler the handler to process WebSocket messages; see
handler, Map<String, Object> PerConnectionWebSocketHandler for providing a handler with
per-connection lifecycle.the attributes from the HTTP handshake to associate with the WebSocket
session; the provided attributes are copied, the original map is not used. attributes)Implements org. Initiate the handshake. |
| public HandshakeHandler | |
| public TransportType | getTransportType()
Implements org. Return the transport type supported by this handler. |
| public void | handleRequest(ServerHttpRequest
the current request request, ServerHttpResponse the current response response, WebSocketHandler the target WebSocketHandler (never wsHandler, SockJsSession null)the SockJS session (never wsSession)null)Implements org. Handle the given request and delegate messages to the provided
|
| public boolean | isRunning()
Implements org. Check whether this component is currently running. |
| public void | setServletContext(ServletContext
the ServletContext object to be used by this object servletContext)Implements org. Set the Invoked after population of normal bean properties but before an init
callback like InitializingBean's |
| public void | |
| public void | stop()
Implements org. Stop this component, typically in a synchronous fashion, such that the component is fully stopped upon return of this method. |
| handshakeHandler | back to summary |
|---|---|
| private final HandshakeHandler handshakeHandler | |
| running | back to summary |
|---|---|
| private volatile boolean running | |
| WebSocketTransportHandler | back to summary |
|---|---|
| public WebSocketTransportHandler(HandshakeHandler handshakeHandler) | |
| checkSessionType | back to summary |
|---|---|
| public boolean checkSessionType(SockJsSession session) Implements org. Doc from org. Check whether the type of the given session matches the transport type
of this
| |
| createSession | back to summary |
|---|---|
| public AbstractSockJsSession createSession(String id, WebSocketHandler handler, Map<String, Object> attrs) Implements org. Doc from org. Create a new SockJS session.
| |
| doHandshake | back to summary |
|---|---|
| public boolean doHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler handler, Map<String, Object> attributes) throws HandshakeFailureException Implements org. Doc from org. Initiate the handshake.
| |
| getHandshakeHandler | back to summary |
|---|---|
| public HandshakeHandler getHandshakeHandler() | |
| getTransportType | back to summary |
|---|---|
| public TransportType getTransportType() Implements org. Doc from org. Return the transport type supported by this handler.
| |
| handleRequest | back to summary |
|---|---|
| public void handleRequest(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, SockJsSession wsSession) throws SockJsException Implements org. Doc from org. Handle the given request and delegate messages to the provided
| |
| isRunning | back to summary |
|---|---|
| public boolean isRunning() Implements org. Doc from org. Check whether this component is currently running. In the case of a container, this will return
| |
| setServletContext | back to summary |
|---|---|
| public void setServletContext(ServletContext servletContext) Implements org. Doc from org. Set the Invoked after population of normal bean properties but before an init
callback like InitializingBean's
| |
| start | back to summary |
|---|---|
| public void start() Implements org. Doc from org. Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate the start signal to all components that apply.
| |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Doc from org. Stop this component, typically in a synchronous fashion, such that the component is
fully stopped upon return of this method. Consider implementing Note that this stop notification is not guaranteed to come before destruction:
On regular shutdown, Should not throw an exception if the component is not running (not started yet). In the case of a container, this will propagate the stop signal to all components that apply.
| |