Class NativeWebSocketConfiguration

    • Constructor Detail

      • NativeWebSocketConfiguration

        public NativeWebSocketConfiguration​(javax.servlet.ServletContext context)
      • NativeWebSocketConfiguration

        public NativeWebSocketConfiguration​(WebSocketServerFactory webSocketServerFactory)
    • Method Detail

      • doStop

        public void doStop()
                    throws java.lang.Exception
        Description copied from class: ContainerLifeCycle
        Stops the managed lifecycle beans in the reverse order they were added.
        Overrides:
        doStop in class ContainerLifeCycle
        Throws:
        java.lang.Exception
      • getFactory

        public WebSocketServerFactory getFactory()
        Get WebSocketServerFactory being used.
        Returns:
        the WebSocketServerFactory being used.
      • getMatched

        public MatchedResource<WebSocketCreator> getMatched​(java.lang.String target)
        Get the matching MatchedResource for the provided target.
        Parameters:
        target - the target path
        Returns:
        the matching resource, or null if no match.
      • getPolicy

        public WebSocketPolicy getPolicy()
        Used to configure the Default WebSocketPolicy used by all endpoints that don't redeclare the values.
        Returns:
        the default policy for all WebSockets
      • addMapping

        public void addMapping​(PathSpec pathSpec,
                               WebSocketCreator creator)
        Manually add a WebSocket mapping.

        If mapping is added before this configuration is started, then it is persisted through stop/start of this configuration's lifecycle. Otherwise it will be removed when this configuration is stopped.

        Specified by:
        addMapping in interface MappedWebSocketCreator
        Parameters:
        pathSpec - the pathspec to respond on
        creator - the websocket creator to activate on the provided mapping.
      • addMapping

        public void addMapping​(PathSpec pathSpec,
                               java.lang.Class<?> endpointClass)
        Manually add a WebSocket mapping.
        Parameters:
        pathSpec - the pathspec to respond on
        endpointClass - the endpoint class to use for new upgrade requests on the provided pathspec (can be an WebSocket annotated POJO, or implementing WebSocketListener)
      • addMapping

        public void addMapping​(java.lang.String rawspec,
                               WebSocketCreator creator)
        Description copied from interface: MappedWebSocketCreator
        Add a mapping, of a pathspec to a WebSocketCreator.

        Recognized Path Spec syntaxes

        /path/to or / or *.ext or servlet|{spec}
        Servlet Syntax
        ^{spec} or regex|{spec}
        Regex Syntax
        uri-template|{spec}
        URI Template (see JSR356 and RFC6570 level 1)
        Specified by:
        addMapping in interface MappedWebSocketCreator
        Parameters:
        rawspec - the path spec to use.
        creator - the websocket creator for this specific mapping
      • addMapping

        public void addMapping​(java.lang.String rawspec,
                               java.lang.Class<?> endpointClass)
        Manually add a WebSocket mapping.
        Parameters:
        rawspec - the pathspec to map to (see MappedWebSocketCreator.addMapping(String, WebSocketCreator) for syntax details)
        endpointClass - the endpoint class to use for new upgrade requests on the provided pathspec (can be an WebSocket annotated POJO, or implementing WebSocketListener)