Class ServerEndpointExporter


  • public class ServerEndpointExporter
    extends java.lang.Object
    Detects beans of type 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 AspectranConfigurator.

    Created: 29/09/2019

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.websocket.server.ServerContainer getServerContainer()
      Return the JSR-356 ServerContainer to use for endpoint registration.
      void initServletContext​(javax.servlet.ServletContext servletContext)  
      void registerEndpoints()
      Actually register the endpoints.
      void setAnnotatedEndpointClasses​(java.lang.Class<?>... annotatedEndpointClasses)
      Explicitly list annotated endpoint types that should be registered on startup.
      void setServerContainer​(javax.websocket.server.ServerContainer serverContainer)
      Set the JSR-356 ServerContainer to use for endpoint registration.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ServerEndpointExporter

        public ServerEndpointExporter​(ActivityContext context)
    • Method Detail

      • getServerContainer

        @Nullable
        public javax.websocket.server.ServerContainer getServerContainer()
        Return the JSR-356 ServerContainer to use for endpoint registration.
      • setServerContainer

        public void setServerContainer​(@Nullable
                                       javax.websocket.server.ServerContainer serverContainer)
        Set the JSR-356 ServerContainer to use for endpoint registration. If not set, the container is going to be retrieved via the ServletContext.
      • initServletContext

        public void initServletContext​(javax.servlet.ServletContext servletContext)
      • setAnnotatedEndpointClasses

        public void setAnnotatedEndpointClasses​(java.lang.Class<?>... annotatedEndpointClasses)
        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.
        Parameters:
        annotatedEndpointClasses - ServerEndpoint-annotated types
      • registerEndpoints

        public void registerEndpoints()
        Actually register the endpoints.