org.eclipse.jetty.client.HttpClient.getConversation()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(122)

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

HttpClient.getConversation介绍

暂无

代码示例

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

@Override
public boolean abort(Throwable cause)
{
  aborted = Objects.requireNonNull(cause);
  // The conversation may be null if it is already completed
  HttpConversation conversation = client.getConversation(getConversationID(), false);
  return conversation != null && conversation.abort(cause);
}

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

@Override
public boolean abort(Throwable cause)
{
  aborted = Objects.requireNonNull(cause);
  // The conversation may be null if it is already completed
  HttpConversation conversation = client.getConversation(getConversationID(), false);
  return conversation != null && conversation.abort(cause);
}

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

private void forwardSuccessComplete(Request request, Response response)
{
  HttpConversation conversation = client.getConversation(request.getConversationID(), false);
  conversation.updateResponseListeners(null);
  notifier.forwardSuccessComplete(conversation.getResponseListeners(), request, response);
}

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

private void forwardSuccessComplete(Request request, Response response)
{
  HttpConversation conversation = client.getConversation(request.getConversationID(), false);
  conversation.updateResponseListeners(null);
  notifier.forwardSuccessComplete(conversation.getResponseListeners(), request, response);
}

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

private void forwardFailureComplete(Request request, Throwable requestFailure, Response response, Throwable responseFailure)
{
  HttpConversation conversation = client.getConversation(request.getConversationID(), false);
  conversation.updateResponseListeners(null);
  notifier.forwardFailureComplete(conversation.getResponseListeners(), request, requestFailure, response, responseFailure);
}

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

private void forwardFailureComplete(Request request, Throwable requestFailure, Response response, Throwable responseFailure)
{
  HttpConversation conversation = client.getConversation(request.getConversationID(), false);
  conversation.updateResponseListeners(null);
  notifier.forwardFailureComplete(conversation.getResponseListeners(), request, requestFailure, response, responseFailure);
}

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

@Override
public void send(Request request, Response.CompleteListener listener)
{
  ArrayList<Response.ResponseListener> listeners = new ArrayList<>(2);
  if (request.getTimeout() > 0)
  {
    TimeoutCompleteListener timeoutListener = new TimeoutCompleteListener(request);
    timeoutListener.schedule(client.getScheduler());
    listeners.add(timeoutListener);
  }
  if (listener != null)
    listeners.add(listener);
  HttpConversation conversation = client.getConversation(request.getConversationID(), true);
  HttpExchange exchange = new HttpExchange(conversation, getDestination(), request, listeners);
  send(exchange);
}

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

@Override
public void send(Request request, Response.CompleteListener listener)
{
  ArrayList<Response.ResponseListener> listeners = new ArrayList<>(2);
  if (request.getTimeout() > 0)
  {
    TimeoutCompleteListener timeoutListener = new TimeoutCompleteListener(request);
    timeoutListener.schedule(client.getScheduler());
    listeners.add(timeoutListener);
  }
  if (listener != null)
    listeners.add(listener);
  HttpConversation conversation = client.getConversation(request.getConversationID(), true);
  HttpExchange exchange = new HttpExchange(conversation, getDestination(), request, listeners);
  send(exchange);
}

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

public void forwardFailureComplete(List<Response.ResponseListener> listeners, Request request, Throwable requestFailure, Response response, Throwable responseFailure)
  {
    HttpConversation conversation = client.getConversation(request.getConversationID(), false);
    forwardFailure(listeners, response, responseFailure);
    conversation.complete();
    notifyComplete(listeners, new Result(request, requestFailure, response, responseFailure));
  }
}

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

@Override
public boolean accept(Request request, Response response)
{
  boolean expect100 = request.getHeaders().contains(HttpHeader.EXPECT, HttpHeaderValue.CONTINUE.asString());
  HttpConversation conversation = client.getConversation(request.getConversationID(), false);
  boolean handled100 = conversation != null && conversation.getAttribute(ATTRIBUTE) != null;
  return expect100 && !handled100;
}

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

public void forwardSuccessComplete(List<Response.ResponseListener> listeners, Request request, Response response)
{
  HttpConversation conversation = client.getConversation(request.getConversationID(), false);
  forwardSuccess(listeners, response);
  conversation.complete();
  notifyComplete(listeners, new Result(request, response));
}

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

@Override
public boolean accept(Request request, Response response)
{
  boolean expect100 = request.getHeaders().contains(HttpHeader.EXPECT, HttpHeaderValue.CONTINUE.asString());
  HttpConversation conversation = client.getConversation(request.getConversationID(), false);
  boolean handled100 = conversation != null && conversation.getAttribute(ATTRIBUTE) != null;
  return expect100 && !handled100;
}

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

public void forwardFailureComplete(List<Response.ResponseListener> listeners, Request request, Throwable requestFailure, Response response, Throwable responseFailure)
  {
    HttpConversation conversation = client.getConversation(request.getConversationID(), false);
    forwardFailure(listeners, response, responseFailure);
    conversation.complete();
    notifyComplete(listeners, new Result(request, requestFailure, response, responseFailure));
  }
}

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

public void forwardSuccessComplete(List<Response.ResponseListener> listeners, Request request, Response response)
{
  HttpConversation conversation = client.getConversation(request.getConversationID(), false);
  forwardSuccess(listeners, response);
  conversation.complete();
  notifyComplete(listeners, new Result(request, response));
}

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

private void fail(Result result, Throwable failure)
  {
    Request request = result.getRequest();
    Response response = result.getResponse();
    HttpConversation conversation = client.getConversation(request.getConversationID(), false);
    conversation.updateResponseListeners(null);
    List<Response.ResponseListener> listeners = conversation.getResponseListeners();
    notifier.notifyFailure(listeners, response, failure);
    notifier.notifyComplete(listeners, new Result(request, response, failure));
  }
}

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

private void fail(Result result, Throwable failure)
  {
    Request request = result.getRequest();
    Response response = result.getResponse();
    HttpConversation conversation = client.getConversation(request.getConversationID(), false);
    conversation.updateResponseListeners(null);
    List<Response.ResponseListener> listeners = conversation.getResponseListeners();
    notifier.notifyFailure(listeners, response, failure);
    notifier.notifyComplete(listeners, new Result(request, response, failure));
  }
}

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

@Override
public void onFailure(Response response, Throwable failure)
{
  HttpConversation conversation = client.getConversation(response.getConversationID(), false);
  // Mark the 100 Continue response as handled
  conversation.setAttribute(ATTRIBUTE, Boolean.TRUE);
  // Reset the conversation listeners to allow the conversation to be completed
  conversation.updateResponseListeners(null);
  HttpExchange exchange = conversation.getExchanges().peekLast();
  assert exchange.getResponse() == response;
  List<Response.ResponseListener> listeners = exchange.getResponseListeners();
  HttpContentResponse contentResponse = new HttpContentResponse(response, getContent(), getEncoding());
  notifier.forwardFailureComplete(listeners, exchange.getRequest(), exchange.getRequestFailure(), contentResponse, failure);
}

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

@Override
public void onFailure(Response response, Throwable failure)
{
  HttpConversation conversation = client.getConversation(response.getConversationID(), false);
  // Mark the 100 Continue response as handled
  conversation.setAttribute(ATTRIBUTE, Boolean.TRUE);
  // Reset the conversation listeners to allow the conversation to be completed
  conversation.updateResponseListeners(null);
  HttpExchange exchange = conversation.getExchanges().peekLast();
  assert exchange.getResponse() == response;
  List<Response.ResponseListener> listeners = exchange.getResponseListeners();
  HttpContentResponse contentResponse = new HttpContentResponse(response, getContent(), getEncoding());
  notifier.forwardFailureComplete(listeners, exchange.getRequest(), exchange.getRequestFailure(), contentResponse, failure);
}

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

private void redirect(Result result, HttpMethod method, URI location)
  HttpConversation conversation = client.getConversation(request.getConversationID(), false);
  Integer redirects = (Integer)conversation.getAttribute(ATTRIBUTE);
  if (redirects == null)

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

private void redirect(Result result, HttpMethod method, URI location)
  HttpConversation conversation = client.getConversation(request.getConversationID(), false);
  Integer redirects = (Integer)conversation.getAttribute(ATTRIBUTE);
  if (redirects == null)

相关文章

HttpClient类方法