Class PerConnectionWebSocketHandler

java.lang.Object
org.springframework.web.socket.handler.PerConnectionWebSocketHandler
All Implemented Interfaces:
Aware, BeanFactoryAware, WebSocketHandler

public class PerConnectionWebSocketHandler extends Object implements 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 BeanFactory, 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.

Since:
4.0
Author:
Rossen Stoyanchev