Package org.springframework.web.socket.server

Examples of org.springframework.web.socket.server.HandshakeFailureException


      return (this.peerConnections != null ?
          exchangeConstructor.newInstance(request, response, this.peerConnections) :
          exchangeConstructor.newInstance(request, response));
    }
    catch (Exception ex) {
      throw new HandshakeFailureException("Failed to instantiate ServletWebSocketHttpExchange", ex);
    }
  }
View Full Code Here


    handshake = new JsrHybi07Handshake(endpoint);
    if (handshake.matches(exchange)) {
      return handshake;
    }
    // Should never occur
    throw new HandshakeFailureException("No matching Undertow Handshake found: " + exchange.getRequestHeaders());
  }
View Full Code Here

    private Writer newInstance(TyrusHttpUpgradeHandler handler) {
      try {
        return (Writer) constructor.newInstance(handler);
      }
      catch (Exception ex) {
        throw new HandshakeFailureException("Failed to instantiate TyrusServletWriter", ex);
      }
    }
View Full Code Here

    try {
      getContainer(servletRequest).doUpgrade(servletRequest, servletResponse, endpointConfig, pathParams);
    }
    catch (ServletException ex) {
      throw new HandshakeFailureException(
          "Servlet request failed to upgrade to WebSocket, uri=" + requestUrl, ex);
    }
    catch (IOException ex) {
      throw new HandshakeFailureException(
          "Response update failed during upgrade to WebSocket, uri=" + requestUrl, ex);
    }
  }
View Full Code Here

      response.setStatusCode(HttpStatus.NOT_FOUND);
      return;
    }

    HandshakeInterceptorChain chain = new HandshakeInterceptorChain(this.interceptors, handler);
    HandshakeFailureException failure = null;

    try {
      Map<String, Object> attributes = new HashMap<String, Object>();
      if (!chain.applyBeforeHandshake(request, response, attributes)) {
        return;
      }
      ((HandshakeHandler) transportHandler).doHandshake(request, response, handler, attributes);
      chain.applyAfterHandshake(request, response, null);
    }
    catch (HandshakeFailureException ex) {
      failure = ex;
    }
    catch (Throwable ex) {
      failure = new HandshakeFailureException("Uncaught failure for request " + request.getURI(), ex);
    }
      finally {
      if (failure != null) {
        chain.applyAfterHandshake(request, response, failure);
        throw failure;
View Full Code Here

    try {
      wsContainerHolder.set(container);
      this.factory.acceptWebSocket(servletRequest, servletResponse);
    }
    catch (IOException ex) {
      throw new HandshakeFailureException(
          "Response update failed during upgrade to WebSocket, uri=" + request.getURI(), ex);
    }
    finally {
      wsContainerHolder.remove();
    }
View Full Code Here

        response.setStatusCode(HttpStatus.BAD_REQUEST);
        return false;
      }
    }
    catch (IOException ex) {
      throw new HandshakeFailureException(
          "Response update failed during upgrade to WebSocket, uri=" + request.getURI(), ex);
    }

    String subProtocol = selectProtocol(headers.getSecWebSocketProtocol(), wsHandler);
    List<WebSocketExtension> requested = headers.getSecWebSocketExtensions();
View Full Code Here

TOP

Related Classes of org.springframework.web.socket.server.HandshakeFailureException

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.