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

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

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

HttpClient.findProtocolHandler介绍

暂无

代码示例

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

ProtocolHandler protocolHandler = client.findProtocolHandler(exchange.getRequest(), response);
Response.Listener handlerListener = null;
if (protocolHandler != null)

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

@Override
public boolean startResponse(HttpVersion version, int status, String reason)
{
  if (updateState(State.IDLE, State.RECEIVE))
  {
    HttpExchange exchange = connection.getExchange();
    // The exchange may be null if it failed concurrently
    if (exchange != null)
    {
      HttpConversation conversation = exchange.getConversation();
      HttpResponse response = exchange.getResponse();
      parser.setHeadResponse(exchange.getRequest().getMethod() == HttpMethod.HEAD);
      response.version(version).status(status).reason(reason);
      // Probe the protocol handlers
      HttpClient client = connection.getHttpClient();
      ProtocolHandler protocolHandler = client.findProtocolHandler(exchange.getRequest(), response);
      Response.Listener handlerListener = null;
      if (protocolHandler != null)
      {
        handlerListener = protocolHandler.getResponseListener();
        LOG.debug("Found protocol handler {}", protocolHandler);
      }
      exchange.getConversation().updateResponseListeners(handlerListener);
      LOG.debug("Receiving {}", response);
      ResponseNotifier notifier = connection.getDestination().getResponseNotifier();
      notifier.notifyBegin(conversation.getResponseListeners(), response);
    }
  }
  return false;
}

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

@Override
public boolean startResponse(HttpVersion version, int status, String reason)
{
  if (updateState(State.IDLE, State.RECEIVE))
  {
    HttpExchange exchange = connection.getExchange();
    // The exchange may be null if it failed concurrently
    if (exchange != null)
    {
      HttpConversation conversation = exchange.getConversation();
      HttpResponse response = exchange.getResponse();
      parser.setHeadResponse(exchange.getRequest().getMethod() == HttpMethod.HEAD);
      response.version(version).status(status).reason(reason);
      // Probe the protocol handlers
      HttpClient client = connection.getHttpClient();
      ProtocolHandler protocolHandler = client.findProtocolHandler(exchange.getRequest(), response);
      Response.Listener handlerListener = null;
      if (protocolHandler != null)
      {
        handlerListener = protocolHandler.getResponseListener();
        LOG.debug("Found protocol handler {}", protocolHandler);
      }
      exchange.getConversation().updateResponseListeners(handlerListener);
      LOG.debug("Receiving {}", response);
      ResponseNotifier notifier = connection.getDestination().getResponseNotifier();
      notifier.notifyBegin(conversation.getResponseListeners(), response);
    }
  }
  return false;
}

相关文章

HttpClient类方法