本文整理了Java中org.eclipse.jetty.client.HttpClient.findProtocolHandler()
方法的一些代码示例,展示了HttpClient.findProtocolHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpClient.findProtocolHandler()
方法的具体详情如下:
包路径:org.eclipse.jetty.client.HttpClient
类名称: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;
}
内容来源于网络,如有侵权,请联系作者删除!