Class 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
  • Constructor Details

  • Method Details

    • getPrelude

      protected abstract byte[] getPrelude(org.springframework.http.server.ServerHttpRequest request)
      Get the prelude to write to the response before any other data.
      Since:
      4.2
    • handleRequestInternal

      protected void handleRequestInternal(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, boolean initialRequest) throws IOException
      Description copied from class: AbstractHttpSockJsSession
      Invoked when a SockJS transport request is received.
      Specified by:
      handleRequestInternal in class AbstractHttpSockJsSession
      Parameters:
      request - the current request
      response - the current response
      initialRequest - 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 class AbstractHttpSockJsSession
      Throws:
      SockJsTransportFailureException