org.apache.http.HttpConnection.isOpen()方法的使用及代码示例

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

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

HttpConnection.isOpen介绍

[英]Checks if this connection is open.
[中]检查此连接是否打开。

代码示例

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

context.getAttribute(ExecutionContext.HTTP_CONNECTION);
if (conn != null && !conn.isOpen())
  return false;

代码示例来源:origin: com.gluonhq/robovm-rt

context.getAttribute(ExecutionContext.HTTP_CONNECTION);
if (conn != null && !conn.isOpen())
  return false;

代码示例来源:origin: MobiVM/robovm

context.getAttribute(ExecutionContext.HTTP_CONNECTION);
if (conn != null && !conn.isOpen())
  return false;

代码示例来源:origin: FlexoVM/flexovm

context.getAttribute(ExecutionContext.HTTP_CONNECTION);
if (conn != null && !conn.isOpen())
  return false;

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

context.getAttribute(ExecutionContext.HTTP_CONNECTION);
if (conn != null && !conn.isOpen())
  return false;

代码示例来源:origin: stackoverflow.com

if (!connection.isOpen()) {
  connection.open();

代码示例来源:origin: ibinti/bugvm

@Override
public Object getUserToken(final HttpContext context) {
  final HttpClientContext clientContext = HttpClientContext.adapt(context);
  Principal userPrincipal = null;
  final AuthState targetAuthState = clientContext.getTargetAuthState();
  if (targetAuthState != null) {
    userPrincipal = getAuthPrincipal(targetAuthState);
    if (userPrincipal == null) {
      final AuthState proxyAuthState = clientContext.getProxyAuthState();
      userPrincipal = getAuthPrincipal(proxyAuthState);
    }
  }
  if (userPrincipal == null) {
    final HttpConnection conn = clientContext.getConnection();
    if (conn.isOpen() && conn instanceof ManagedHttpClientConnection) {
      final SSLSession sslsession = ((ManagedHttpClientConnection) conn).getSSLSession();
      if (sslsession != null) {
        userPrincipal = sslsession.getLocalPrincipal();
      }
    }
  }
  return userPrincipal;
}

代码示例来源:origin: com.bugvm/bugvm-rt

@Override
public Object getUserToken(final HttpContext context) {
  final HttpClientContext clientContext = HttpClientContext.adapt(context);
  Principal userPrincipal = null;
  final AuthState targetAuthState = clientContext.getTargetAuthState();
  if (targetAuthState != null) {
    userPrincipal = getAuthPrincipal(targetAuthState);
    if (userPrincipal == null) {
      final AuthState proxyAuthState = clientContext.getProxyAuthState();
      userPrincipal = getAuthPrincipal(proxyAuthState);
    }
  }
  if (userPrincipal == null) {
    final HttpConnection conn = clientContext.getConnection();
    if (conn.isOpen() && conn instanceof ManagedHttpClientConnection) {
      final SSLSession sslsession = ((ManagedHttpClientConnection) conn).getSSLSession();
      if (sslsession != null) {
        userPrincipal = sslsession.getLocalPrincipal();
      }
    }
  }
  return userPrincipal;
}

代码示例来源:origin: Nextdoor/bender

@Override
public Object getUserToken(final HttpContext context) {
  final HttpClientContext clientContext = HttpClientContext.adapt(context);
  Principal userPrincipal = null;
  final AuthState targetAuthState = clientContext.getTargetAuthState();
  if (targetAuthState != null) {
    userPrincipal = getAuthPrincipal(targetAuthState);
    if (userPrincipal == null) {
      final AuthState proxyAuthState = clientContext.getProxyAuthState();
      userPrincipal = getAuthPrincipal(proxyAuthState);
    }
  }
  if (userPrincipal == null) {
    final HttpConnection conn = clientContext.getConnection();
    if (conn.isOpen() && conn instanceof ManagedHttpClientConnection) {
      final SSLSession sslsession = ((ManagedHttpClientConnection) conn).getSSLSession();
      if (sslsession != null) {
        userPrincipal = sslsession.getLocalPrincipal();
      }
    }
  }
  return userPrincipal;
}

代码示例来源:origin: org.apache.httpcomponents/httpclient-android

public Object getUserToken(final HttpContext context) {
  final HttpClientContext clientContext = HttpClientContext.adapt(context);
  Principal userPrincipal = null;
  final AuthStateHC4 targetAuthState = clientContext.getTargetAuthState();
  if (targetAuthState != null) {
    userPrincipal = getAuthPrincipal(targetAuthState);
    if (userPrincipal == null) {
      final AuthStateHC4 proxyAuthState = clientContext.getProxyAuthState();
      userPrincipal = getAuthPrincipal(proxyAuthState);
    }
  }
  if (userPrincipal == null) {
    final HttpConnection conn = clientContext.getConnection();
    if (conn.isOpen() && conn instanceof ManagedHttpClientConnection) {
      final SSLSession sslsession = ((ManagedHttpClientConnection) conn).getSSLSession();
      if (sslsession != null) {
        userPrincipal = sslsession.getLocalPrincipal();
      }
    }
  }
  return userPrincipal;
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient

public Object getUserToken(final HttpContext context) {
  final HttpClientContext clientContext = HttpClientContext.adapt(context);
  Principal userPrincipal = null;
  final AuthState targetAuthState = clientContext.getTargetAuthState();
  if (targetAuthState != null) {
    userPrincipal = getAuthPrincipal(targetAuthState);
    if (userPrincipal == null) {
      final AuthState proxyAuthState = clientContext.getProxyAuthState();
      userPrincipal = getAuthPrincipal(proxyAuthState);
    }
  }
  if (userPrincipal == null) {
    final HttpConnection conn = clientContext.getConnection();
    if (conn.isOpen() && conn instanceof ManagedHttpClientConnection) {
      final SSLSession sslsession = ((ManagedHttpClientConnection) conn).getSSLSession();
      if (sslsession != null) {
        userPrincipal = sslsession.getLocalPrincipal();
      }
    }
  }
  return userPrincipal;
}

代码示例来源:origin: com.hynnet/httpclient

@Override
public Object getUserToken(final HttpContext context) {
  final HttpClientContext clientContext = HttpClientContext.adapt(context);
  Principal userPrincipal = null;
  final AuthState targetAuthState = clientContext.getTargetAuthState();
  if (targetAuthState != null) {
    userPrincipal = getAuthPrincipal(targetAuthState);
    if (userPrincipal == null) {
      final AuthState proxyAuthState = clientContext.getProxyAuthState();
      userPrincipal = getAuthPrincipal(proxyAuthState);
    }
  }
  if (userPrincipal == null) {
    final HttpConnection conn = clientContext.getConnection();
    if (conn.isOpen() && conn instanceof ManagedHttpClientConnection) {
      final SSLSession sslsession = ((ManagedHttpClientConnection) conn).getSSLSession();
      if (sslsession != null) {
        userPrincipal = sslsession.getLocalPrincipal();
      }
    }
  }
  return userPrincipal;
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

@Override
public Object getUserToken(final HttpContext context) {
  final HttpClientContext clientContext = HttpClientContext.adapt(context);
  Principal userPrincipal = null;
  final AuthState targetAuthState = clientContext.getTargetAuthState();
  if (targetAuthState != null) {
    userPrincipal = getAuthPrincipal(targetAuthState);
    if (userPrincipal == null) {
      final AuthState proxyAuthState = clientContext.getProxyAuthState();
      userPrincipal = getAuthPrincipal(proxyAuthState);
    }
  }
  if (userPrincipal == null) {
    final HttpConnection conn = clientContext.getConnection();
    if (conn.isOpen() && conn instanceof ManagedHttpClientConnection) {
      final SSLSession sslsession = ((ManagedHttpClientConnection) conn).getSSLSession();
      if (sslsession != null) {
        userPrincipal = sslsession.getLocalPrincipal();
      }
    }
  }
  return userPrincipal;
}

相关文章