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

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

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

HttpClient.removeDestination介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public void returnIdleConnection(AbstractHttpConnection connection)
{
  // TODO work out the real idle time;
  long idleForMs = connection.getEndPoint() != null ? connection.getEndPoint().getMaxIdleTime() : -1;
  connection.onIdleExpired(idleForMs);
  boolean startConnection = false;
  boolean remove = false;
  synchronized (this)
  {
    _idleConnections.remove(connection);
    _connections.remove(connection);
    if (_exchanges.isEmpty())
      remove=_client.isRemoveIdleDestinations() && ( _cookies==null || _cookies.isEmpty() ) &&_connections.isEmpty() && _idleConnections.isEmpty();
    else if (_client.isStarted())
      startConnection = true;
  }
  if (startConnection)
    startNewConnection();
  if (remove)
    _client.removeDestination(this);
}

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

private void tryRemoveIdleDestination()
{
  if (getHttpClient().isRemoveIdleDestinations() && connectionPool.isEmpty())
  {
    // There is a race condition between this thread removing the destination
    // and another thread queueing a request to this same destination.
    // If this destination is removed, but the request queued, a new connection
    // will be opened, the exchange will be executed and eventually the connection
    // will idle timeout and be closed. Meanwhile a new destination will be created
    // in HttpClient and will be used for other requests.
    getHttpClient().removeDestination(this);
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

startNewConnection();
if (remove)
  _client.removeDestination(this);

相关文章

HttpClient类方法