Package org.eclipse.jetty.websocket

Examples of org.eclipse.jetty.websocket.WebSocket$Outbound


     */
    @Override
    protected WebSocket doWebSocketConnect(final HttpServletRequest request, final String protocol) {
        logger.info("WebSocket upgrade requested");

        return new WebSocket() {
            private WebSocketProcessor webSocketProcessor;

            @Override
            public void onConnect(WebSocket.Outbound outbound) {
                webSocketProcessor = new WebSocketProcessor(AtmosphereServlet.this, new JettyWebSocketSupport(outbound));
View Full Code Here


      server.setHandler(new WebSocketHandler()
      {
        @Override
        public WebSocket doWebSocketConnect(HttpServletRequest arg0, String arg1)
        {
          return new WebSocket() 
          {
            @Override
            public void onOpen(Connection connection)
            {
              compilerNotificationConnection = connection;
View Full Code Here

        Mockito.when(servletConfig.getServletContext()).thenReturn(servletContext);
       
        XmppWebSocketServlet servlet = new XmppWebSocketServlet();
        servlet.init(servletConfig);
       
        WebSocket webSocket = servlet.doWebSocketConnect(null, "xmpp");
        Assert.assertTrue(webSocket instanceof WebSocketBackedSessionContext);
    }
View Full Code Here

    @Test
    public void doWebSocketConnectWithDirectCstr() throws ServletException {
        XmppWebSocketServlet servlet = new XmppWebSocketServlet(serverRuntimeContext);
       
        WebSocket webSocket = servlet.doWebSocketConnect(null, "xmpp");
        Assert.assertTrue(webSocket instanceof WebSocketBackedSessionContext);
    }
View Full Code Here

    @Test
    public void doWebSocketConnectWithInvalidSubprotocl() throws ServletException {
        XmppWebSocketServlet servlet = new XmppWebSocketServlet(serverRuntimeContext);
       
        WebSocket webSocket = servlet.doWebSocketConnect(null, "dummy");
        Assert.assertNull(webSocket);
    }
View Full Code Here

    @Override
    protected WebSocket doWebSocketConnect(final HttpServletRequest request, final String protocol) {
        if (logger.isLoggable(Level.INFO)) {
            logger.info("WebSocket upgrade requested");
        }
        return new WebSocket() {
            private WebSocketProcessor webSocketProcessor;

            public void onConnect(WebSocket.Outbound outbound) {
                webSocketProcessor = new WebSocketProcessor(AtmosphereServlet.this, new JettyWebSocketSupport(outbound));
                try {
View Full Code Here

    }

    @Test
    public void testDoWebSocketConnect() {
        websocketComponentServlet.setConsumer(consumer);
        WebSocket webSocket = websocketComponentServlet.doWebSocketConnect(request, PROTOCOL);
        assertNotNull(webSocket);
        assertEquals(DefaultWebsocket.class, webSocket.getClass());
        DefaultWebsocket defaultWebsocket = (DefaultWebsocket) webSocket;
        defaultWebsocket.setConnectionKey(CONNECTION_KEY);
        defaultWebsocket.onMessage(MESSAGE);
        InOrder inOrder = inOrder(consumer, sync, request);
        inOrder.verify(consumer, times(1)).sendMessage(CONNECTION_KEY, MESSAGE);
View Full Code Here

        inOrder.verifyNoMoreInteractions();
    }

    @Test
    public void testDoWebSocketConnectConsumerIsNull() {
        WebSocket webSocket = websocketComponentServlet.doWebSocketConnect(request, PROTOCOL);
        assertNotNull(webSocket);
        assertEquals(DefaultWebsocket.class, webSocket.getClass());
        DefaultWebsocket defaultWebsocket = (DefaultWebsocket) webSocket;
        defaultWebsocket.setConnectionKey(CONNECTION_KEY);
        defaultWebsocket.onMessage(MESSAGE);
        InOrder inOrder = inOrder(consumer, sync, request);
        inOrder.verifyNoMoreInteractions();
View Full Code Here

        getServletContext().getNamedDispatcher("default").forward(request,response);
    }

    @Override
    public WebSocket doWebSocketConnect(HttpServletRequest request, String protocol) {
        WebSocket socket;
        if (protocol.startsWith("mqtt")) {
            socket = new MQTTSocket();
        } else {
            socket = new StompSocket();
        }
View Full Code Here

        getServletContext().getNamedDispatcher("default").forward(request,response);
    }

    @Override
    public WebSocket doWebSocketConnect(HttpServletRequest request, String protocol) {
        WebSocket socket;
        if (protocol != null && protocol.startsWith("mqtt")) {
            socket = new MQTTSocket();
        } else {
            socket = new StompSocket();
        }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.websocket.WebSocket$Outbound

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.