open class PerConnectionWebSocketHandler : WebSocketHandler, BeanFactoryAware
A WebSocketHandler that initializes and destroys a WebSocketHandler instance for each WebSocket connection and delegates all other methods to it.
Essentially create an instance of this class once, providing the type of WebSocketHandler class to create for each connection, and then pass it to any API method that expects a WebSocketHandler.
If initializing the target WebSocketHandler type requires a Spring BeanFctory, then the #setBeanFactory(BeanFactory) property accordingly. Simply declaring this class as a Spring bean will do that. Otherwise, WebSocketHandler instances of the target type will be created using the default constructor.
Author
Rossen Stoyanchev
Since
4.0
PerConnectionWebSocketHandler(handlerType: Class<out WebSocketHandler>)PerConnectionWebSocketHandler(handlerType: Class<out WebSocketHandler>, supportsPartialMessages: Boolean) |
open fun afterConnectionClosed(session: WebSocketSession, closeStatus: CloseStatus): Unit |
|
open fun afterConnectionEstablished(session: WebSocketSession): Unit |
|
open fun handleMessage(session: WebSocketSession, message: WebSocketMessage<*>): Unit |
|
open fun handleTransportError(session: WebSocketSession, exception: Throwable): Unit |
|
open fun setBeanFactory(beanFactory: BeanFactory): Unit |
|
open fun supportsPartialMessages(): Boolean |
|
open fun toString(): String |