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


Java Args.positive方法代码示例

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


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

示例1: BHttpConnectionBase

import org.apache.http.util.Args; //导入方法依赖的package包/类
/**
 * Creates new instance of BHttpConnectionBase.
 *
 * @param buffersize buffer size. Must be a positive number.
 * @param fragmentSizeHint fragment size hint.
 * @param chardecoder decoder to be used for decoding HTTP protocol elements.
 *   If <code>null</code> simple type cast will be used for byte to char conversion.
 * @param charencoder encoder to be used for encoding HTTP protocol elements.
 *   If <code>null</code> simple type cast will be used for char to byte conversion.
 * @param constraints Message constraints. If <code>null</code>
 *   {@link MessageConstraints#DEFAULT} will be used.
 * @param incomingContentStrategy incoming content length strategy. If <code>null</code>
 *   {@link LaxContentLengthStrategyHC4#INSTANCE} will be used.
 * @param outgoingContentStrategy outgoing content length strategy. If <code>null</code>
 *   {@link StrictContentLengthStrategyHC4#INSTANCE} will be used.
 */
protected BHttpConnectionBase(
        final int buffersize,
        final int fragmentSizeHint,
        final CharsetDecoder chardecoder,
        final CharsetEncoder charencoder,
        final MessageConstraints constraints,
        final ContentLengthStrategy incomingContentStrategy,
        final ContentLengthStrategy outgoingContentStrategy) {
    super();
    Args.positive(buffersize, "Buffer size");
    final HttpTransportMetricsImpl inTransportMetrics = new HttpTransportMetricsImpl();
    final HttpTransportMetricsImpl outTransportMetrics = new HttpTransportMetricsImpl();
    this.inbuffer = new SessionInputBufferImpl(inTransportMetrics, buffersize, -1,
            constraints != null ? constraints : MessageConstraints.DEFAULT, chardecoder);
    this.outbuffer = new SessionOutputBufferImpl(outTransportMetrics, buffersize, fragmentSizeHint,
            charencoder);
    this.connMetrics = new HttpConnectionMetricsImpl(inTransportMetrics, outTransportMetrics);
    this.incomingContentStrategy = incomingContentStrategy != null ? incomingContentStrategy :
        LaxContentLengthStrategyHC4.INSTANCE;
    this.outgoingContentStrategy = outgoingContentStrategy != null ? outgoingContentStrategy :
        StrictContentLengthStrategyHC4.INSTANCE;
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:39,代码来源:BHttpConnectionBase.java

示例2: SessionInputBufferImpl

import org.apache.http.util.Args; //导入方法依赖的package包/类
/**
 * Creates new instance of SessionInputBufferImpl.
 *
 * @param metrics HTTP transport metrics.
 * @param buffersize buffer size. Must be a positive number.
 * @param minChunkLimit size limit below which data chunks should be buffered in memory
 *   in order to minimize native method invocations on the underlying network socket.
 *   The optimal value of this parameter can be platform specific and defines a trade-off
 *   between performance of memory copy operations and that of native method invocation.
 *   If negative default chunk limited will be used.
 * @param constraints Message constraints. If <code>null</code>
 *   {@link MessageConstraints#DEFAULT} will be used.
 * @param chardecoder chardecoder to be used for decoding HTTP protocol elements.
 *   If <code>null</code> simple type cast will be used for byte to char conversion.
 */
public SessionInputBufferImpl(
        final HttpTransportMetricsImpl metrics,
        final int buffersize,
        final int minChunkLimit,
        final MessageConstraints constraints,
        final CharsetDecoder chardecoder) {
    Args.notNull(metrics, "HTTP transport metrcis");
    Args.positive(buffersize, "Buffer size");
    this.metrics = metrics;
    this.buffer = new byte[buffersize];
    this.bufferpos = 0;
    this.bufferlen = 0;
    this.minChunkLimit = minChunkLimit >= 0 ? minChunkLimit : 512;
    this.constraints = constraints != null ? constraints : MessageConstraints.DEFAULT;
    this.linebuffer = new ByteArrayBuffer(buffersize);
    this.decoder = chardecoder;
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:33,代码来源:SessionInputBufferImpl.java

示例3: DefaultServiceUnavailableRetryStrategy

import org.apache.http.util.Args; //导入方法依赖的package包/类
public DefaultServiceUnavailableRetryStrategy(final int maxRetries, final int retryInterval) {
    super();
    Args.positive(maxRetries, "Max retries");
    Args.positive(retryInterval, "Retry interval");
    this.maxRetries = maxRetries;
    this.retryInterval = retryInterval;
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:8,代码来源:DefaultServiceUnavailableRetryStrategy.java

示例4: SessionOutputBufferImpl

import org.apache.http.util.Args; //导入方法依赖的package包/类
/**
 * Creates new instance of SessionOutputBufferImpl.
 *
 * @param metrics HTTP transport metrics.
 * @param buffersize buffer size. Must be a positive number.
 * @param fragementSizeHint fragment size hint defining a minimal size of a fragment
 *   that should be written out directly to the socket bypassing the session buffer.
 *   Value <code>0</code> disables fragment buffering.
 * @param charencoder charencoder to be used for encoding HTTP protocol elements.
 *   If <code>null</code> simple type cast will be used for char to byte conversion.
 */
public SessionOutputBufferImpl(
        final HttpTransportMetricsImpl metrics,
        final int buffersize,
        final int fragementSizeHint,
        final CharsetEncoder charencoder) {
    super();
    Args.positive(buffersize, "Buffer size");
    Args.notNull(metrics, "HTTP transport metrcis");
    this.metrics = metrics;
    this.buffer = new ByteArrayBuffer(buffersize);
    this.fragementSizeHint = fragementSizeHint >= 0 ? fragementSizeHint : 0;
    this.encoder = charencoder;
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:25,代码来源:SessionOutputBufferImpl.java

示例5: setDefaultMaxPerRoute

import org.apache.http.util.Args; //导入方法依赖的package包/类
public void setDefaultMaxPerRoute(final int max) {
    Args.positive(max, "Default max per route");
    this.defaultMax = max;
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:5,代码来源:ConnPerRouteBean.java

示例6: setMaxForRoute

import org.apache.http.util.Args; //导入方法依赖的package包/类
public void setMaxForRoute(final HttpRoute route, final int max) {
    Args.notNull(route, "HTTP route");
    Args.positive(max, "Max per route");
    this.maxPerHostMap.put(route, Integer.valueOf(max));
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:6,代码来源:ConnPerRouteBean.java

示例7: setCooldownMillis

import org.apache.http.util.Args; //导入方法依赖的package包/类
/**
 * Sets the amount of time, in milliseconds, to wait between
 * adjustments in pool sizes for a given host, to allow
 * enough time for the adjustments to take effect. Defaults
 * to 5000L (5 seconds).
 * @param l must be positive
 */
public void setCooldownMillis(final long l) {
    Args.positive(coolDown, "Cool down");
    coolDown = l;
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:12,代码来源:AIMDBackoffManager.java

示例8: setPerHostConnectionCap

import org.apache.http.util.Args; //导入方法依赖的package包/类
/**
 * Sets the absolute maximum per-host connection pool size to
 * probe up to; defaults to 2 (the default per-host max).
 * @param cap must be >= 1
 */
public void setPerHostConnectionCap(final int cap) {
    Args.positive(cap, "Per host connection cap");
    this.cap = cap;
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:10,代码来源:AIMDBackoffManager.java

示例9: setPerHostConnectionCap

import org.apache.http.util.Args; //导入方法依赖的package包/类
/**
 * Sets the absolute maximum per-host connection pool size to
 * probe up to; defaults to 2 (the default per-host max).
 * @param cap must be &gt;= 1
 */
public void setPerHostConnectionCap(final int cap) {
    Args.positive(cap, "Per host connection cap");
    this.cap = cap;
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:10,代码来源:AIMDBackoffManager.java


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