当前位置: 首页>>代码示例>>Java>>正文


Java ClientConfig.getMaxRetryTimes方法代码示例

本文整理汇总了Java中cn.jiguang.common.ClientConfig.getMaxRetryTimes方法的典型用法代码示例。如果您正苦于以下问题:Java ClientConfig.getMaxRetryTimes方法的具体用法?Java ClientConfig.getMaxRetryTimes怎么用?Java ClientConfig.getMaxRetryTimes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cn.jiguang.common.ClientConfig的用法示例。


在下文中一共展示了ClientConfig.getMaxRetryTimes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: NettyHttpClient

import cn.jiguang.common.ClientConfig; //导入方法依赖的package包/类
public NettyHttpClient(String authCode, HttpProxy proxy, ClientConfig config) {
    _maxRetryTimes = config.getMaxRetryTimes();
    _readTimeout = config.getReadTimeout();
    String message = MessageFormat.format("Created instance with "
                    + "connectionTimeout {0}, readTimeout {1}, maxRetryTimes {2}, SSL Version {3}",
            config.getConnectionTimeout(), _readTimeout, _maxRetryTimes, config.getSSLVersion());
    LOG.debug(message);
    _authCode = authCode;

    try {
        _sslCtx = SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE).build();
        _workerGroup = new NioEventLoopGroup();
        b = new Bootstrap(); // (1)
        b.group(_workerGroup); // (2)
        b.channel(NioSocketChannel.class); // (3)
        b.option(ChannelOption.SO_KEEPALIVE, true); // (4)
    } catch (SSLException e) {
        e.printStackTrace();
    }
}
 
开发者ID:jpush,项目名称:jiguang-java-client-common,代码行数:21,代码来源:NettyHttpClient.java

示例2: Http2Client

import cn.jiguang.common.ClientConfig; //导入方法依赖的package包/类
public Http2Client(String authCode, HttpProxy proxy, ClientConfig config) {
    _maxRetryTimes = config.getMaxRetryTimes();
    _connectionTimeout = config.getConnectionTimeout();
    _readTimeout = config.getReadTimeout();
    _sslVer = config.getSSLVersion();

    _authCode = authCode;
    _proxy = proxy;

    String message = MessageFormat.format("Created instance with "
                    + "connectionTimeout {0}, readTimeout {1}, maxRetryTimes {2}, SSL Version {3}",
            _connectionTimeout, _readTimeout, _maxRetryTimes, _sslVer);
    LOG.info(message);

    if (null != _proxy && _proxy.isAuthenticationNeeded()) {
        Authenticator.setDefault(new NativeHttpClient.SimpleProxyAuthenticator(
                _proxy.getUsername(), _proxy.getPassword()));
    }
}
 
开发者ID:jpush,项目名称:jiguang-java-client-common,代码行数:20,代码来源:Http2Client.java

示例3: NativeHttpClient

import cn.jiguang.common.ClientConfig; //导入方法依赖的package包/类
public NativeHttpClient(String authCode, HttpProxy proxy, ClientConfig config ) {
      _maxRetryTimes = config.getMaxRetryTimes();
_connectionTimeout = config.getConnectionTimeout();
_readTimeout = config.getReadTimeout();
_sslVer = config.getSSLVersion();

_authCode = authCode;
_proxy = proxy;

String message = MessageFormat.format("Created instance with "
				+ "connectionTimeout {0}, readTimeout {1}, maxRetryTimes {2}, SSL Version {3}",
		_connectionTimeout, _readTimeout, _maxRetryTimes, _sslVer);
      LOG.debug(message);

      if ( null != _proxy && _proxy.isAuthenticationNeeded()) {
      	Authenticator.setDefault(new SimpleProxyAuthenticator(
              _proxy.getUsername(), _proxy.getPassword()));
      }
      initSSL(_sslVer);
  }
 
开发者ID:jpush,项目名称:jiguang-java-client-common,代码行数:21,代码来源:NativeHttpClient.java

示例4: ApacheHttpClient

import cn.jiguang.common.ClientConfig; //导入方法依赖的package包/类
public ApacheHttpClient(String authCode, HttpProxy proxy, ClientConfig config) {
    _maxRetryTimes = config.getMaxRetryTimes();
    _connectionTimeout = config.getConnectionTimeout();
    _connectionRequestTimeout = config.getConnectionRequestTimeout();
    _socketTimeout = config.getSocketTimeout();
    _authCode = authCode;
    if (proxy != null) {
        _proxy = new HttpHost(proxy.getHost(), proxy.getPort());
    }
}
 
开发者ID:jpush,项目名称:jiguang-java-client-common,代码行数:11,代码来源:ApacheHttpClient.java


注:本文中的cn.jiguang.common.ClientConfig.getMaxRetryTimes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。