Class ServerEndpointRegistration
java.lang.Object
jakarta.websocket.server.ServerEndpointConfig.Configurator
org.springframework.web.socket.server.standard.ServerEndpointRegistration
- All Implemented Interfaces:
- jakarta.websocket.EndpointConfig, jakarta.websocket.server.ServerEndpointConfig, Aware, BeanFactoryAware
public class ServerEndpointRegistration
extends jakarta.websocket.server.ServerEndpointConfig.Configurator
implements jakarta.websocket.server.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.ServerEndpointConfigjakarta.websocket.server.ServerEndpointConfig.Builder, jakarta.websocket.server.ServerEndpointConfig.Configurator
- 
Constructor SummaryConstructorsConstructorDescriptionServerEndpointRegistration(String path, jakarta.websocket.Endpoint endpoint) Create a newServerEndpointRegistrationinstance from anjakarta.websocket.Endpointinstance.ServerEndpointRegistration(String path, Class<? extends jakarta.websocket.Endpoint> endpointClass) Create a newServerEndpointRegistrationinstance from anjakarta.websocket.Endpointclass.
- 
Method SummaryModifier and TypeMethodDescriptionjakarta.websocket.server.ServerEndpointConfig.Configuratorjakarta.websocket.EndpointClass<? extends jakarta.websocket.Endpoint> final <T> TgetEndpointInstance(Class<T> clazz) List<jakarta.websocket.Extension> getPath()voidmodifyHandshake(jakarta.websocket.server.ServerEndpointConfig sec, jakarta.websocket.server.HandshakeRequest request, jakarta.websocket.HandshakeResponse response) voidsetBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.voidsetDecoders(List<Class<? extends jakarta.websocket.Decoder>> decoders) voidsetEncoders(List<Class<? extends jakarta.websocket.Encoder>> encoders) voidsetExtensions(List<jakarta.websocket.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
 
- 
ServerEndpointRegistrationpublic ServerEndpointRegistration(String path, Class<? extends jakarta.websocket.Endpoint> endpointClass) Create a newServerEndpointRegistrationinstance from anjakarta.websocket.Endpointclass.- Parameters:
- path- the endpoint path
- endpointClass- the endpoint class
 
 
- 
- 
Method Details- 
getPath- Specified by:
- getPathin interface- jakarta.websocket.server.ServerEndpointConfig
 
- 
getEndpointClass- Specified by:
- getEndpointClassin interface- jakarta.websocket.server.ServerEndpointConfig
 
- 
getEndpointpublic jakarta.websocket.Endpoint getEndpoint()
- 
setSubprotocols
- 
getSubprotocols
- 
setExtensions
- 
getExtensions- Specified by:
- getExtensionsin interface- jakarta.websocket.server.ServerEndpointConfig
 
- 
setEncoders
- 
getEncoders
- 
setDecoders
- 
getDecoders
- 
setUserProperties
- 
getUserProperties
- 
getConfiguratorpublic jakarta.websocket.server.ServerEndpointConfig.Configurator getConfigurator()- Specified by:
- getConfiguratorin interface- jakarta.websocket.server.ServerEndpointConfig
 
- 
getEndpointInstance- Overrides:
- getEndpointInstancein class- jakarta.websocket.server.ServerEndpointConfig.Configurator
- Throws:
- InstantiationException
 
- 
modifyHandshakepublic void modifyHandshake(jakarta.websocket.server.ServerEndpointConfig sec, jakarta.websocket.server.HandshakeRequest request, jakarta.websocket.HandshakeResponse response) - Overrides:
- modifyHandshakein class- jakarta.websocket.server.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
 
-