接口的使用
org.springframework.messaging.simp.stomp.StompSession
使用StompSession的程序包 程序包 说明 org.springframework.messaging.simp.stomp Generic support for simple messaging protocols (like STOMP).org.springframework.web.socket.messaging WebSocket integration for Spring's messaging module.org.springframework.messaging.simp.stomp中StompSession的使用
org.springframework.messaging.simp.stomp中StompSession的子接口 修饰符和类型 接口 说明 interfaceConnectionHandlingStompSessionAStompSessionthat implementsTcpConnectionHandlerin order to send and receive messages.实现StompSession的org.springframework.messaging.simp.stomp中的类 修饰符和类型 类 说明 classDefaultStompSessionDefault implementation ofConnectionHandlingStompSession.返回变量类型为StompSession的类型的org.springframework.messaging.simp.stomp中的方法 修饰符和类型 方法 说明 ListenableFuture<StompSession>ReactorNettyTcpStompClient. connect(StompHeaders connectHeaders, StompSessionHandler handler)An overloaded version ofReactorNettyTcpStompClient.connect(StompSessionHandler)that accepts headers to use for the STOMP CONNECT frame.ListenableFuture<StompSession>ReactorNettyTcpStompClient. connect(StompSessionHandler handler)Connect and notify the givenStompSessionHandlerwhen connected on the STOMP level.ListenableFuture<StompSession>ConnectionHandlingStompSession. getSessionFuture()Return a future that will complete when the session is ready for use.ListenableFuture<StompSession>DefaultStompSession. getSessionFuture()参数类型为StompSession的org.springframework.messaging.simp.stomp中的方法 修饰符和类型 方法 说明 voidStompSessionHandler. afterConnected(StompSession session, StompHeaders connectedHeaders)Invoked when the session is ready to use, i.e. after the underlying transport (TCP, WebSocket) is connected and a STOMP CONNECTED frame is received from the broker.voidStompSessionHandlerAdapter. afterConnected(StompSession session, StompHeaders connectedHeaders)This implementation is empty.voidStompSessionHandler. handleException(StompSession session, StompCommand command, StompHeaders headers, byte[] payload, Throwable exception)Handle any exception arising while processing a STOMP frame such as a failure to convert the payload or an unhandled exception in the applicationStompFrameHandler.voidStompSessionHandlerAdapter. handleException(StompSession session, StompCommand command, StompHeaders headers, byte[] payload, Throwable exception)This implementation is empty.voidStompSessionHandler. handleTransportError(StompSession session, Throwable exception)Handle a low level transport error which could be an I/O error or a failure to encode or decode a STOMP message.voidStompSessionHandlerAdapter. handleTransportError(StompSession session, Throwable exception)This implementation is empty.org.springframework.web.socket.messaging中StompSession的使用
返回变量类型为StompSession的类型的org.springframework.web.socket.messaging中的方法 修饰符和类型 方法 说明 ListenableFuture<StompSession>WebSocketStompClient. connect(String url, StompSessionHandler handler, Object... uriVars)Connect to the given WebSocket URL and notify the givenStompSessionHandlerwhen connected on the STOMP level after the CONNECTED frame is received.ListenableFuture<StompSession>WebSocketStompClient. connect(String url, WebSocketHttpHeaders handshakeHeaders, StompHeaders connectHeaders, StompSessionHandler handler, Object... uriVariables)An overloaded version ofWebSocketStompClient.connect(String, StompSessionHandler, Object...)that also acceptsWebSocketHttpHeadersto use for the WebSocket handshake andStompHeadersfor the STOMP CONNECT frame.ListenableFuture<StompSession>WebSocketStompClient. connect(String url, WebSocketHttpHeaders handshakeHeaders, StompSessionHandler handler, Object... uriVariables)An overloaded version ofWebSocketStompClient.connect(String, StompSessionHandler, Object...)that also acceptsWebSocketHttpHeadersto use for the WebSocket handshake.ListenableFuture<StompSession>WebSocketStompClient. connect(URI url, WebSocketHttpHeaders handshakeHeaders, StompHeaders connectHeaders, StompSessionHandler sessionHandler)An overloaded version ofWebSocketStompClient.connect(String, WebSocketHttpHeaders, StompSessionHandler, Object...)that accepts a fully preparedURI.