Interface WebSocketServletFactory

  • All Known Implementing Classes:
    WebSocketServerFactory

    public interface WebSocketServletFactory
    Basic WebSocketServletFactory for working with Jetty-based WebSocketServlets
    • Method Detail

      • acceptWebSocket

        boolean acceptWebSocket​(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • acceptWebSocket

        boolean acceptWebSocket​(WebSocketCreator creator,
                                javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • start

        void start()
            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • stop

        void stop()
           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getAvailableExtensionNames

        java.util.Set<java.lang.String> getAvailableExtensionNames()
        Get the set of available Extensions by registered name.
        Returns:
        the set of available extensions by registered name.
      • getExtensionFactory

        @Deprecated
        ExtensionFactory getExtensionFactory()
        Deprecated.
        this class is removed from Jetty 10.0.0+. To remove specific extensions from negotiation use WebSocketCreator to remove then during handshake.
        Get the registered extensions for this WebSocket factory.
        Returns:
        the ExtensionFactory
        See Also:
        getAvailableExtensionNames()
      • getPolicy

        WebSocketPolicy getPolicy()
        Get the base policy in use for WebSockets.

        Note: individual WebSocket implementations can override some of the values in here by using the @WebSocket annotation.

        Returns:
        the base policy
      • isUpgradeRequest

        boolean isUpgradeRequest​(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
      • register

        void register​(java.lang.Class<?> websocketPojo)
        Register a websocket class pojo with the default WebSocketCreator.

        Note: only required if using the default WebSocketCreator provided by this factory.

        Parameters:
        websocketPojo - the class to instantiate for each incoming websocket upgrade request.