Search in sources :

Example 11 with WebSocketServletFactory

use of org.eclipse.jetty.websocket.servlet.WebSocketServletFactory in project cxf by apache.

the class Jetty9WebSocketDestination method getWebSocketFactory.

public synchronized WebSocketServletFactory getWebSocketFactory(Server server) {
    if (webSocketFactory == null) {
        webSockethandler = new WebSocketHandler() {

            @Override
            public void configure(WebSocketServletFactory factory) {
            }
        };
        try {
            webSockethandler.setServer(server);
            webSockethandler.start();
        } catch (Exception e) {
            e.printStackTrace();
        }
        webSocketFactory = webSockethandler.getWebSocketFactory();
        webSocketFactory.setCreator(new Creator());
    }
    return webSocketFactory;
}
Also used : WebSocketServletFactory(org.eclipse.jetty.websocket.servlet.WebSocketServletFactory) WebSocketHandler(org.eclipse.jetty.websocket.server.WebSocketHandler) WebSocketCreator(org.eclipse.jetty.websocket.servlet.WebSocketCreator) InvalidPathException(org.apache.cxf.transport.websocket.InvalidPathException) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) UnsupportedEncodingException(java.io.UnsupportedEncodingException)

Aggregations

WebSocketServletFactory (org.eclipse.jetty.websocket.servlet.WebSocketServletFactory)11 Server (org.eclipse.jetty.server.Server)4 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)4 WebSocketCreator (org.eclipse.jetty.websocket.servlet.WebSocketCreator)4 Consumer (org.apache.camel.Consumer)3 ConnectorRef (org.apache.camel.component.websocket.WebsocketComponent.ConnectorRef)3 ServerConnector (org.eclipse.jetty.server.ServerConnector)3 Test (org.junit.Test)3 IOException (java.io.IOException)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 WebSocketHandler (org.eclipse.jetty.websocket.server.WebSocketHandler)2 ServletUpgradeRequest (org.eclipse.jetty.websocket.servlet.ServletUpgradeRequest)2 WebSocketServlet (org.eclipse.jetty.websocket.servlet.WebSocketServlet)2 InstrumentedQueuedThreadPool (com.codahale.metrics.jetty9.InstrumentedQueuedThreadPool)1 BuckEventExternalInterface (com.facebook.buck.event.external.events.BuckEventExternalInterface)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Maps (com.google.common.collect.Maps)1 InstrumentedHandler (com.kixeye.chassis.transport.http.InstrumentedHandler)1 MessageSerDe (com.kixeye.chassis.transport.serde.MessageSerDe)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1