Class StompSessionHandlerAdapter

java.lang.Object
org.springframework.messaging.simp.stomp.StompSessionHandlerAdapter
All Implemented Interfaces:
StompFrameHandler, StompSessionHandler

public abstract class StompSessionHandlerAdapter extends Object implements StompSessionHandler
Abstract adapter class for StompSessionHandler with mostly empty implementation methods except for getPayloadType(org.springframework.messaging.simp.stomp.StompHeaders) which returns String as the default Object type expected for STOMP ERROR frame payloads.
Since:
4.2
Author:
Rossen Stoyanchev
  • Constructor Details

    • StompSessionHandlerAdapter

      public StompSessionHandlerAdapter()
  • Method Details

    • getPayloadType

      public Type getPayloadType(StompHeaders headers)
      This implementation returns String as the expected payload type for STOMP ERROR frames.
      Specified by:
      getPayloadType in interface StompFrameHandler
      Parameters:
      headers - the headers of a message
    • handleFrame

      public void handleFrame(StompHeaders headers, @Nullable Object payload)
      This implementation is empty.
      Specified by:
      handleFrame in interface StompFrameHandler
      Parameters:
      headers - the headers of the frame
      payload - the payload, or null if there was no payload
    • afterConnected

      public void afterConnected(StompSession session, StompHeaders connectedHeaders)
      This implementation is empty.
      Specified by:
      afterConnected in interface StompSessionHandler
      Parameters:
      session - the client STOMP session
      connectedHeaders - the STOMP CONNECTED frame headers
    • handleException

      public void handleException(StompSession session, @Nullable StompCommand command, StompHeaders headers, byte[] payload, Throwable exception)
      This implementation is empty.
      Specified by:
      handleException in interface StompSessionHandler
      Parameters:
      session - the client STOMP session
      command - the STOMP command of the frame
      headers - the headers
      payload - the raw payload
      exception - the exception
    • handleTransportError

      public void handleTransportError(StompSession session, Throwable exception)
      This implementation is empty.
      Specified by:
      handleTransportError in interface StompSessionHandler
      Parameters:
      session - the client STOMP session
      exception - the exception that occurred