Class ServerEndpointRegistration
java.lang.Object
jakarta.websocket.server.ServerEndpointConfig.Configurator
org.springframework.web.socket.server.standard.ServerEndpointRegistration
- All Implemented Interfaces:
- EndpointConfig,- ServerEndpointConfig,- Aware,- BeanFactoryAware
public class ServerEndpointRegistration
extends ServerEndpointConfig.Configurator
implements ServerEndpointConfig, BeanFactoryAware
An implementation of 
ServerEndpointConfig for use in
 Spring-based applications. A ServerEndpointRegistration bean is detected by
 ServerEndpointExporter and registered with a Jakarta WebSocket runtime at startup.
 Class constructors accept a singleton Endpoint instance
 or an Endpoint specified by type Class. When specified by type, the endpoint
 will be instantiated and initialized through the Spring ApplicationContext before
 each client WebSocket connection.
 
This class also extends
 ServerEndpointConfig.Configurator to make it easier
 to override methods for customizing the handshake process.
- Since:
- 4.0
- Author:
- Rossen Stoyanchev, Juergen Hoeller
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface jakarta.websocket.server.ServerEndpointConfigServerEndpointConfig.Builder, ServerEndpointConfig.Configurator
- 
Constructor SummaryConstructorsConstructorDescriptionServerEndpointRegistration(String path, Endpoint endpoint) Create a newServerEndpointRegistrationinstance from anjakarta.websocket.Endpointinstance.ServerEndpointRegistration(String path, Class<? extends Endpoint> endpointClass) Create a newServerEndpointRegistrationinstance from anjakarta.websocket.Endpointclass.
- 
Method SummaryModifier and TypeMethodDescriptionfinal <T> TgetEndpointInstance(Class<T> clazz) getPath()voidmodifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) voidsetBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.voidsetDecoders(List<Class<? extends Decoder>> decoders) voidsetEncoders(List<Class<? extends Encoder>> encoders) voidsetExtensions(List<Extension> extensions) voidsetSubprotocols(List<String> subprotocols) voidsetUserProperties(Map<String, Object> userProperties) toString()Methods inherited from class jakarta.websocket.server.ServerEndpointConfig.ConfiguratorcheckOrigin, getContainerDefaultConfigurator, getNegotiatedExtensions, getNegotiatedSubprotocol
- 
Constructor Details- 
ServerEndpointRegistrationCreate a newServerEndpointRegistrationinstance from anjakarta.websocket.Endpointinstance.- Parameters:
- path- the endpoint path
- endpoint- the endpoint instance
 
- 
ServerEndpointRegistrationCreate a newServerEndpointRegistrationinstance from anjakarta.websocket.Endpointclass.- Parameters:
- path- the endpoint path
- endpointClass- the endpoint class
 
 
- 
- 
Method Details- 
getPath- Specified by:
- getPathin interface- ServerEndpointConfig
 
- 
getEndpointClass- Specified by:
- getEndpointClassin interface- ServerEndpointConfig
 
- 
getEndpoint
- 
setSubprotocols
- 
getSubprotocols- Specified by:
- getSubprotocolsin interface- ServerEndpointConfig
 
- 
setExtensions
- 
getExtensions- Specified by:
- getExtensionsin interface- ServerEndpointConfig
 
- 
setEncoders
- 
getEncoders- Specified by:
- getEncodersin interface- EndpointConfig
 
- 
setDecoders
- 
getDecoders- Specified by:
- getDecodersin interface- EndpointConfig
 
- 
setUserProperties
- 
getUserProperties- Specified by:
- getUserPropertiesin interface- EndpointConfig
 
- 
getConfigurator- Specified by:
- getConfiguratorin interface- ServerEndpointConfig
 
- 
getEndpointInstance- Overrides:
- getEndpointInstancein class- ServerEndpointConfig.Configurator
- Throws:
- InstantiationException
 
- 
modifyHandshakepublic void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) - Overrides:
- modifyHandshakein class- ServerEndpointConfig.Configurator
 
- 
setBeanFactoryDescription copied from interface:BeanFactoryAwareCallback that supplies the owning factory to a bean instance.Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet()or a custom init-method.- Specified by:
- setBeanFactoryin interface- BeanFactoryAware
- Parameters:
- beanFactory- owning BeanFactory (never- null). The bean can immediately call methods on the factory.
- See Also:
 
- 
toString
 
-