Websocket 1.0 WebSocketServlet replacement

Viewed 2966

I'm trying to adopt old code that uses (now deprecated) WebSocketServlet. The old code looks like this:

@Singleton
ExampleServlet extends WebSocketServlet {
    @Override
    protected StreamInbound createWebSocketInbound(String subProtocol, HttpServletRequest request) {
        // Do something
        // ...

        return // StreamInbound impl;
    }
}

As I said in the newer version of the tomcat 7 there is WebSocket implementation backported from tomcat 8 (WebSocket 1.0, Tyrus) and class WebSocketServlet is deprecated.

What I should use instead to deploy my servlet with newer API?

2 Answers
Related