org.eclipse.jetty.client.api.Request.abort()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(158)

本文整理了Java中org.eclipse.jetty.client.api.Request.abort方法的一些代码示例,展示了Request.abort的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.abort方法的具体详情如下:
包路径:org.eclipse.jetty.client.api.Request
类名称:Request
方法名:abort

Request.abort介绍

[英]Attempts to abort the send of this request.
[中]试图中止此请求的发送。

代码示例

代码示例来源:origin: jersey/jersey

if (throwable != null && throwable instanceof CancellationException) {
  jettyRequest.abort(throwable);

代码示例来源:origin: resteasy/Resteasy

@Override
 public boolean cancel(boolean mayInterruptIfRunning) {
   final boolean cancelled = super.cancel(mayInterruptIfRunning);
   if (mayInterruptIfRunning && cancelled) {
    request.abort(new CancellationException());
   }
   return cancelled;
 }
}

代码示例来源:origin: org.eclipse.jetty/jetty-client

@Override
public boolean abort(Throwable cause)
{
  return request.abort(cause);
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
public boolean abort(Throwable cause)
{
  return request.abort(cause);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
public boolean abort(Throwable cause)
{
  return request.abort(cause);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
public boolean cancel(boolean mayInterruptIfRunning)
{
  cancelled = true;
  return request.abort(new CancellationException());
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
public boolean cancel(boolean mayInterruptIfRunning)
{
  cancelled = true;
  return request.abort(new CancellationException());
}

代码示例来源:origin: org.eclipse.jetty/jetty-client

@Override
public boolean cancel(boolean mayInterruptIfRunning)
{
  cancelled = true;
  return request.abort(new CancellationException());
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
  public void run()
  {
    request.abort(new TimeoutException("Total timeout elapsed"));
  }
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
  public void run()
  {
    request.abort(new TimeoutException("Total timeout elapsed"));
  }
}

代码示例来源:origin: org.cometd.java/cometd-java-client

@Override
public void abort() {
  List<Request> requests = new ArrayList<>();
  synchronized (this) {
    _aborted = true;
    requests.addAll(_requests);
    _requests.clear();
  }
  for (Request request : requests) {
    request.abort(new Exception("Transport " + this + " aborted"));
  }
}

代码示例来源:origin: org.eclipse.jetty/jetty-client

@Override
  public void onBegin(Request redirect)
  {
    Throwable cause = httpRequest.getAbortCause();
    if (cause != null)
      redirect.abort(cause);
  }
});

代码示例来源:origin: blazegraph/database

/**
 * Abort the request/response. The request is associated with the http
 * request/response is aborted. If we already have the response, then it's
 * {@link InputStream} is closed.
 * 
 * @param cause
 *            The cause (required).
 */
public void abort(final Throwable cause) {
  final InputStream is = m_cachedStream;
  if (is != null) {
    m_cachedStream = null;
    try {
      is.close();
    } catch (IOException ex) {
      log.warn(ex);
    }
  }
  final Request r = m_request;
  if (r != null) {
    m_request = null;
    r.abort(cause);
  }
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
  public void onBegin(Request redirect)
  {
    Throwable cause = request.getAbortCause();
    if (cause != null)
      redirect.abort(cause);
  }
});

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
  public void onBegin(Request redirect)
  {
    Throwable cause = request.getAbortCause();
    if (cause != null)
      redirect.abort(cause);
  }
});

代码示例来源:origin: org.eclipse.jetty/jetty-proxy

protected void onClientRequestFailure(HttpServletRequest clientRequest, Request proxyRequest, HttpServletResponse proxyResponse, Throwable failure)
{
  boolean aborted = proxyRequest.abort(failure);
  if (!aborted)
  {
    int status = failure instanceof TimeoutException ?
        HttpStatus.REQUEST_TIMEOUT_408 :
        HttpStatus.INTERNAL_SERVER_ERROR_500;
    sendProxyResponseError(clientRequest, proxyResponse, status);
  }
}

代码示例来源:origin: airlift/airlift

@Override
public boolean cancel(boolean mayInterruptIfRunning)
{
  try {
    stats.recordRequestCanceled();
    state.set(JettyAsyncHttpState.CANCELED);
    jettyRequest.abort(new CancellationException());
    return super.cancel(mayInterruptIfRunning);
  }
  catch (Throwable e) {
    setException(e);
    return true;
  }
}

代码示例来源:origin: org.eclipse.jetty/jetty-client

@Override
public void onTimeoutExpired()
{
  Request request = this.request.getAndSet(null);
  if (LOG.isDebugEnabled())
    LOG.debug("Total timeout {} ms elapsed for {}", request.getTimeout(), request);
  if (request != null)
    request.abort(new TimeoutException("Total timeout " + request.getTimeout() + " ms elapsed"));
}

代码示例来源:origin: com.proofpoint.platform/http-client

@Override
public boolean cancel(boolean mayInterruptIfRunning)
{
  try {
    state.set(JettyAsyncHttpState.CANCELED);
    jettyRequest.abort(new CancellationException());
    return super.cancel(mayInterruptIfRunning);
  }
  catch (Throwable e) {
    try (TraceTokenScope ignored = registerTraceToken(traceToken)) {
      setException(e);
    }
    return true;
  }
}

代码示例来源:origin: com.cisco.oss.foundation/http-client-jetty

jettyHttpClient.execute(request, responseCallback, loadBalancerStrategy, apiName);
} catch (Throwable e) {
  result.getRequest().abort(e);
  responseCallback.failed(e);

相关文章