public class ServerEndpointExporter
extends org.springframework.web.context.support.WebApplicationObjectSupport
implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.InitializingBean
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.
ServerEndpointRegistration,
SpringConfigurator,
ServletServerContainerFactoryBean| Constructor and Description |
|---|
ServerEndpointExporter() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected ServerContainer |
getServerContainer()
Return the JSR-356
ServerContainer to use for endpoint registration. |
protected void |
initApplicationContext(org.springframework.context.ApplicationContext context) |
protected void |
initServletContext(ServletContext servletContext) |
Object |
postProcessAfterInitialization(Object bean,
String beanName) |
Object |
postProcessBeforeInitialization(Object bean,
String beanName) |
protected void |
registerEndpoints()
Actually register the endpoints.
|
void |
setAnnotatedEndpointClasses(Class<?>... annotatedEndpointClasses)
Explicitly list annotated endpoint types that should be registered on startup.
|
void |
setServerContainer(ServerContainer serverContainer)
Set the JSR-356
ServerContainer to use for endpoint registration. |
getServletContext, getTempDir, getWebApplicationContext, isContextRequired, setServletContextpublic void setServerContainer(ServerContainer serverContainer)
ServerContainer to use for endpoint registration.
If not set, the container is going to be retrieved via the ServletContext.protected ServerContainer getServerContainer()
ServerContainer to use for endpoint registration.public void setAnnotatedEndpointClasses(Class<?>... annotatedEndpointClasses)
annotatedEndpointClasses - ServerEndpoint-annotated typesprotected void initApplicationContext(org.springframework.context.ApplicationContext context)
initApplicationContext in class org.springframework.web.context.support.WebApplicationObjectSupportprotected void initServletContext(ServletContext servletContext)
initServletContext in class org.springframework.web.context.support.WebApplicationObjectSupportpublic void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanprotected void registerEndpoints()
afterPropertiesSet().public Object postProcessBeforeInitialization(Object bean, String beanName)
postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor