Top Description Constructors Methods
org.springframework.web.socket.sockjs.transport.session

public Class PollingSockJsSession

extends AbstractHttpSockJsSession
Class Inheritance
Imports
java.io.IOException, java.util.Map, org.springframework.http.server.ServerHttpRequest, .ServerHttpResponse, org.springframework.web.socket.WebSocketHandler, org.springframework.web.socket.sockjs.SockJsTransportFailureException, org.springframework.web.socket.sockjs.frame.SockJsFrame, .SockJsMessageCodec, org.springframework.web.socket.sockjs.transport.SockJsServiceConfig

A SockJS session for use with polling HTTP transports.
Author
Rossen Stoyanchev
Since
4.0

Constructor Summary

AccessConstructor and Description
public
PollingSockJsSession(String sessionId, SockJsServiceConfig config, WebSocketHandler wsHandler, Map<String, Object> attributes)

Method Summary

Modifier and TypeMethod and Description
protected void
flushCache()

Implements abstract org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.flushCache.

Called when the connection is active and ready to write to the response.

protected void
handleRequestInternal(ServerHttpRequest
the current request
request
,
ServerHttpResponse
the current response
response
,
boolean
whether it is the first request for the session
initialRequest
)

Implements abstract org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.handleRequestInternal.

Invoked when a SockJS transport request is received.

protected void
writeFrame(SockJsFrame frame)

Overrides org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.writeFrame.

For internal use within a TransportHandler and the (TransportHandler-specific) session class.

Inherited from org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession:
disconnectgetAcceptedProtocolgetBinaryMessageSizeLimitgetExtensionsgetHandshakeHeadersgetLocalAddressgetMessageCachegetPrincipalgetRemoteAddressgetTextMessageSizeLimitgetUrihandleInitialRequesthandleSuccessiveRequestisActiveresetRequestsendMessageInternalsetAcceptedProtocolsetBinaryMessageSizeLimitsetTextMessageSizeLimitwriteFrameInternal

Constructor Detail

PollingSockJsSessionback to summary
public PollingSockJsSession(String sessionId, SockJsServiceConfig config, WebSocketHandler wsHandler, Map<String, Object> attributes)

Method Detail

flushCacheback to summary
protected void flushCache() throws SockJsTransportFailureException

Implements abstract org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.flushCache.

Doc from org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.flushCache.

Called when the connection is active and ready to write to the response. Subclasses should only call this method from a method where the "responseLock" is acquired.

Annotations
@Override
handleRequestInternalback to summary
protected void handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, boolean initialRequest) throws IOException

Implements abstract org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.handleRequestInternal.

Doc from org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.handleRequestInternal.

Invoked when a SockJS transport request is received.

Parameters
request:ServerHttpRequest

the current request

response:ServerHttpResponse

the current response

initialRequest:boolean

whether it is the first request for the session

Annotations
@Override
writeFrameback to summary
protected void writeFrame(SockJsFrame frame) throws SockJsTransportFailureException

Overrides org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.writeFrame.

Doc from org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.writeFrame.

For internal use within a TransportHandler and the (TransportHandler-specific) session class.

Annotations
@Override