Class PollingSockJsSession
java.lang.Object
org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession
org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession
org.springframework.web.socket.sockjs.transport.session.PollingSockJsSession
- All Implemented Interfaces:
Closeable,AutoCloseable,SockJsSession,WebSocketSession
A SockJS session for use with polling HTTP transports.
- Since:
- 4.0
- Author:
- Rossen Stoyanchev
-
Field Summary
Fields inherited from class org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession
DISCONNECTED_CLIENT_LOG_CATEGORY, disconnectedClientLogger, logger, responseLock -
Constructor Summary
ConstructorsConstructorDescriptionPollingSockJsSession(String sessionId, SockJsServiceConfig config, WebSocketHandler wsHandler, Map<String, Object> attributes) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalled when the connection is active and ready to write to the response.protected voidhandleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, boolean initialRequest) Invoked when a SockJS transport request is received.protected voidwriteFrame(SockJsFrame frame) For internal use within a TransportHandler and the (TransportHandler-specific) session class.Methods inherited from class org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession
disconnect, getAcceptedProtocol, getBinaryMessageSizeLimit, getExtensions, getHandshakeHeaders, getLocalAddress, getMessageCache, getPrincipal, getRemoteAddress, getTextMessageSizeLimit, getUri, handleInitialRequest, handleSuccessiveRequest, isActive, resetRequest, sendMessageInternal, setAcceptedProtocol, setBinaryMessageSizeLimit, setTextMessageSizeLimit, writeFrameInternalMethods inherited from class org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession
cancelHeartbeat, close, close, delegateConnectionClosed, delegateConnectionEstablished, delegateError, delegateMessages, disableHeartbeat, getAttributes, getId, getMessageCodec, getSockJsServiceConfig, getTimeSinceLastActive, isClosed, isNew, isOpen, scheduleHeartbeat, sendHeartbeat, sendMessage, toString, tryCloseWithSockJsTransportError, updateLastActiveTime
-
Constructor Details
-
PollingSockJsSession
public PollingSockJsSession(String sessionId, SockJsServiceConfig config, WebSocketHandler wsHandler, Map<String, Object> attributes)
-
-
Method Details
-
handleRequestInternal
protected void handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, boolean initialRequest) throws IOException Description copied from class:AbstractHttpSockJsSessionInvoked when a SockJS transport request is received.- Specified by:
handleRequestInternalin classAbstractHttpSockJsSession- Parameters:
request- the current requestresponse- the current responseinitialRequest- whether it is the first request for the session- Throws:
IOException
-
flushCache
Description copied from class:AbstractHttpSockJsSessionCalled 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.- Specified by:
flushCachein classAbstractHttpSockJsSession- Throws:
SockJsTransportFailureException
-
writeFrame
Description copied from class:AbstractSockJsSessionFor internal use within a TransportHandler and the (TransportHandler-specific) session class.- Overrides:
writeFramein classAbstractSockJsSession- Throws:
SockJsTransportFailureException
-