Class StreamingSockJsSession
- 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.StreamingSockJsSession
- All Implemented Interfaces:
Closeable
,AutoCloseable
,SockJsSession
,WebSocketSession
public abstract class StreamingSockJsSession extends AbstractHttpSockJsSession
A SockJS session for use with streaming 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
Constructors Constructor Description StreamingSockJsSession(String sessionId, SockJsServiceConfig config, WebSocketHandler wsHandler, Map<String,Object> attributes)
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
flushCache()
Called when the connection is active and ready to write to the response.protected abstract byte[]
getPrelude(ServerHttpRequest request)
Get the prelude to write to the response before any other data.protected void
handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, boolean initialRequest)
Invoked when a SockJS transport request is received.protected boolean
isStreaming()
Deprecated.as of 4.2, since this method is no longer used.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, writeFrameInternal, writePrelude
Methods 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, writeFrame
Constructor Detail
StreamingSockJsSession
public StreamingSockJsSession(String sessionId, SockJsServiceConfig config, WebSocketHandler wsHandler, Map<String,Object> attributes)
Method Detail
isStreaming
@Deprecated protected boolean isStreaming()
Deprecated.as of 4.2, since this method is no longer used.- Specified by:
isStreaming
in classAbstractHttpSockJsSession
getPrelude
protected abstract byte[] getPrelude(ServerHttpRequest request)
Get the prelude to write to the response before any other data.- Since:
- 4.2
handleRequestInternal
protected void handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, boolean initialRequest) throws IOException
Description copied from class:AbstractHttpSockJsSession
Invoked when a SockJS transport request is received.- Specified by:
handleRequestInternal
in classAbstractHttpSockJsSession
- Parameters:
request
- the current requestresponse
- the current responseinitialRequest
- whether it is the first request for the session- Throws:
IOException
flushCache
protected void flushCache() throws SockJsTransportFailureException
Description copied from class:AbstractHttpSockJsSession
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.- Specified by:
flushCache
in classAbstractHttpSockJsSession
- Throws:
SockJsTransportFailureException