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

Package org.springframework.web.socket.server.standard

Types

AbstractStandardUpgradeStrategy

abstract class AbstractStandardUpgradeStrategy : RequestUpgradeStrategy

A base class for RequestUpgradeStrategy implementations that build on the standard WebSocket API for Java (JSR-356).

AbstractTyrusRequestUpgradeStrategy

abstract class AbstractTyrusRequestUpgradeStrategy : AbstractStandardUpgradeStrategy

A base class for RequestUpgradeStrategy implementations on top of JSR-356 based servers which include Tyrus as their WebSocket engine.

Works with Tyrus 1.11 (WebLogic 12.2.1) and Tyrus 1.12 (GlassFish 4.1.1).

GlassFishRequestUpgradeStrategy

open class GlassFishRequestUpgradeStrategy : AbstractTyrusRequestUpgradeStrategy

A WebSocket RequestUpgradeStrategy for Oracle's GlassFish 4.1 and higher.

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.

ServletServerContainerFactoryBean

open class ServletServerContainerFactoryBean : FactoryBean<WebSocketContainer>, ServletContextAware, InitializingBean

A FactoryBean for configuring javax.websocket.server.ServerContainer. Since there is usually only one ServerContainer instance accessible under a well-known javax.servlet.ServletContext attribute, simply declaring this FactoryBean and using its setters allows for configuring the ServerContainer through Spring configuration.

This is useful even if the ServerContainer is not injected into any other bean within the Spring application context. For example, an application can configure a org.springframework.web.socket.server.support.DefaultHandshakeHandler, a org.springframework.web.socket.sockjs.SockJsService, or ServerEndpointExporter, and separately declare this FactoryBean in order to customize the properties of the (one and only) ServerContainer instance.

SpringConfigurator

open class SpringConfigurator : Configurator

A javax.websocket.server.ServerEndpointConfig.Configurator for initializing ServerEndpoint-annotated classes through Spring.

 @ServerEndpoint(value = "/echo", configurator = SpringConfigurator.class) public class EchoEndpoint { // ... } 

TomcatRequestUpgradeStrategy

open class TomcatRequestUpgradeStrategy : AbstractStandardUpgradeStrategy

A WebSocket RequestUpgradeStrategy for Apache Tomcat. Compatible with all versions of Tomcat that support JSR-356, i.e. Tomcat 7.0.47+ and higher.

To modify properties of the underlying javax.websocket.server.ServerContainer you can use ServletServerContainerFactoryBean in XML configuration or, when using Java configuration, access the container instance through the "javax.websocket.server.ServerContainer" ServletContext attribute.

UndertowRequestUpgradeStrategy

open class UndertowRequestUpgradeStrategy : AbstractStandardUpgradeStrategy

A WebSocket RequestUpgradeStrategy for WildFly and its underlying Undertow web server. Also compatible with embedded Undertow usage.

Requires Undertow 1.3.5+ as of Spring Framework 5.0.

WebLogicRequestUpgradeStrategy

open class WebLogicRequestUpgradeStrategy : AbstractTyrusRequestUpgradeStrategy

A WebSocket RequestUpgradeStrategy for Oracle's WebLogic. Supports 12.1.3 as well as 12.2.1, as of Spring Framework 4.2.3.

WebSphereRequestUpgradeStrategy

open class WebSphereRequestUpgradeStrategy : AbstractStandardUpgradeStrategy

WebSphere support for upgrading an HttpServletRequest during a WebSocket handshake. To modify properties of the underlying javax.websocket.server.ServerContainer you can use ServletServerContainerFactoryBean in XML configuration or, when using Java configuration, access the container instance through the "javax.websocket.server.ServerContainer" ServletContext attribute.

Tested with WAS Liberty beta (August 2015) for the upcoming 8.5.5.7 release.