本文整理汇总了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();
}
}
示例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()));
}
}
示例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);
}
示例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());
}
}