Package org.springframework.web.socket.sockjs

Examples of org.springframework.web.socket.sockjs.SockJsTransportFailureException


        return;
      }
    }
    catch (Throwable ex) {
      sockJsSession.tryCloseWithSockJsTransportError(ex, CloseStatus.SERVER_ERROR);
      throw new SockJsTransportFailureException("Failed to send error", sockJsSession.getId(), ex);
    }

    super.handleRequestInternal(request, response, sockJsSession);
  }
View Full Code Here


      try {
        response.getBody().write("\"callback\" parameter required".getBytes("UTF-8"));
      }
      catch (IOException t) {
        sockJsSession.tryCloseWithSockJsTransportError(t, CloseStatus.SERVER_ERROR);
        throw new SockJsTransportFailureException("Failed to write to response", sockJsSession.getId(), t);
      }
      return;
    }

    super.handleRequestInternal(request, response, sockJsSession);
View Full Code Here

        response.getBody().write(html.getBytes("UTF-8"));
        response.flush();
      }
      catch (IOException e) {
        tryCloseWithSockJsTransportError(e, CloseStatus.SERVER_ERROR);
        throw new SockJsTransportFailureException("Failed to write HTML content", getId(), e);
      }
    }
View Full Code Here

      finally {
        IoUtils.safeClose(connection);
      }
    }
    catch (IOException ex) {
      throw new SockJsTransportFailureException("Failed to execute request to " + url, null, ex);
    }
    catch(InterruptedException ex) {
      throw new SockJsTransportFailureException("Failed to execute request to " + url, null, ex);
    }

  }
View Full Code Here

        onFailure(latch, ex);
      }

      private void onFailure(final CountDownLatch latch, IOException ex) {
        latch.countDown();
        throw new SockJsTransportFailureException("Failed to execute request", null, ex);
      }
    };
  }
View Full Code Here

          result.sendRequest(httpRequest, createConnectCallback(url, getRequestHeaders(), session, connectFuture));
        }

        @Override
        public void failed(IOException ex) {
          throw new SockJsTransportFailureException("Failed to execute request to " + url, null, ex);
        }
      },
      url, this.worker, this.bufferPool, this.optionMap);

  }
View Full Code Here

    ContentResponse response;
    try {
      response = httpRequest.send();
    }
    catch (Exception ex) {
      throw new SockJsTransportFailureException("Failed to execute request to " + url, null, ex);
    }
    HttpStatus status = HttpStatus.valueOf(response.getStatus());
    HttpHeaders responseHeaders = toHttpHeaders(response.getHeaders());
    return (response.getContent() != null ?
      new ResponseEntity<String>(response.getContentAsString(), responseHeaders, status) :
View Full Code Here

      wsHandler = new SockJsWebSocketHandler(getServiceConfig(), wsHandler, sockJsSession);
      this.handshakeHandler.doHandshake(request, response, wsHandler, Collections.<String, Object>emptyMap());
    }
    catch (Throwable ex) {
      sockJsSession.tryCloseWithSockJsTransportError(ex, CloseStatus.SERVER_ERROR);
      throw new SockJsTransportFailureException("WebSocket handshake failure", wsSession.getId(), ex);
    }
  }
View Full Code Here

    private void handleFailure(Throwable ex, boolean isTimeoutFailure) {
      if (this.handled.compareAndSet(false, true)) {
        if (isTimeoutFailure) {
          String message = "Connect timed out for " + DefaultTransportRequest.this;
          logger.error(message);
          ex = new SockJsTransportFailureException(message, getSockJsUrlInfo().getSessionId(), null);
        }
        if (fallbackRequest != null) {
          logger.error(DefaultTransportRequest.this + " failed. Falling back on next transport.", ex);
          fallbackRequest.connect(this.handler, this.future);
        }
View Full Code Here

          startAsyncRequest();
        }
      }
      catch (Throwable ex) {
        tryCloseWithSockJsTransportError(ex, CloseStatus.SERVER_ERROR);
        throw new SockJsTransportFailureException("Failed to open session", getId(), ex);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.web.socket.sockjs.SockJsTransportFailureException

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.