spring-framework / org.springframework.web.socket.server.standard / ServerEndpointExporter

ServerEndpointExporter

open class ServerEndpointExporter : WebApplicationObjectSupport, InitializingBean, SmartInitializingSingleton

Detects beans of type javax.websocket.server.ServerEndpointConfig and registers with the standard Java WebSocket runtime. Also detects beans annotated with ServerEndpoint and registers them as well. Although not required, it is likely annotated endpoints should have their configurator property set to SpringConfigurator.

When this class is used, by declaring it in Spring configuration, it should be possible to turn off a Servlet container's scan for WebSocket endpoints. This can be done with the help of the <absolute-ordering> element in web.xml.

Author
Rossen Stoyanchev

Author
Juergen Hoeller

Since
4.0

See Also
ServerEndpointRegistrationSpringConfiguratorServletServerContainerFactoryBean

Constructors

<init>

ServerEndpointExporter()

Detects beans of type javax.websocket.server.ServerEndpointConfig and registers with the standard Java WebSocket runtime. Also detects beans annotated with ServerEndpoint and registers them as well. Although not required, it is likely annotated endpoints should have their configurator property set to SpringConfigurator.

When this class is used, by declaring it in Spring configuration, it should be possible to turn off a Servlet container's scan for WebSocket endpoints. This can be done with the help of the <absolute-ordering> element in web.xml.

Functions

afterPropertiesSet

open fun afterPropertiesSet(): Unit

afterSingletonsInstantiated

open fun afterSingletonsInstantiated(): Unit

setAnnotatedEndpointClasses

open fun setAnnotatedEndpointClasses(vararg annotatedEndpointClasses: Class<*>): Unit

Explicitly list annotated endpoint types that should be registered on startup. This can be done if you wish to turn off a Servlet container's scan for endpoints, which goes through all 3rd party jars in the, and rely on Spring configuration instead.

setServerContainer

open fun setServerContainer(serverContainer: ServerContainer): Unit

Set the JSR-356 ServerContainer to use for endpoint registration. If not set, the container is going to be retrieved via the ServletContext.