Java 类org.apache.http.ConnectionReuseStrategy 实例源码

项目:lams    文件:DefaultRequestDirector.java   
@Deprecated
public DefaultRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    this(LogFactory.getLog(DefaultRequestDirector.class),
            requestExec, conman, reustrat, kastrat, rouplan, httpProcessor, retryHandler,
            new DefaultRedirectStrategyAdaptor(redirectHandler),
            new AuthenticationStrategyAdaptor(targetAuthHandler),
            new AuthenticationStrategyAdaptor(proxyAuthHandler),
            userTokenHandler,
            params);
}
项目:lams    文件:DefaultRequestDirector.java   
@Deprecated
public DefaultRequestDirector(
        final Log log,
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectStrategy redirectStrategy,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    this(LogFactory.getLog(DefaultRequestDirector.class),
            requestExec, conman, reustrat, kastrat, rouplan, httpProcessor, retryHandler,
            redirectStrategy,
            new AuthenticationStrategyAdaptor(targetAuthHandler),
            new AuthenticationStrategyAdaptor(proxyAuthHandler),
            userTokenHandler,
            params);
}
项目:remote-files-sync    文件:MinimalClientExec.java   
public MinimalClientExec(
        final HttpRequestExecutor requestExecutor,
        final HttpClientConnectionManager connManager,
        final ConnectionReuseStrategy reuseStrategy,
        final ConnectionKeepAliveStrategy keepAliveStrategy) {
    Args.notNull(requestExecutor, "HTTP request executor");
    Args.notNull(connManager, "Client connection manager");
    Args.notNull(reuseStrategy, "Connection reuse strategy");
    Args.notNull(keepAliveStrategy, "Connection keep alive strategy");
    this.httpProcessor = new ImmutableHttpProcessor(
            new RequestContentHC4(),
            new RequestTargetHostHC4(),
            new RequestClientConnControl(),
            new RequestUserAgentHC4(VersionInfoHC4.getUserAgent(
                    "Apache-HttpClient", "org.apache.http.client", getClass())));
    this.requestExecutor    = requestExecutor;
    this.connManager        = connManager;
    this.reuseStrategy      = reuseStrategy;
    this.keepAliveStrategy  = keepAliveStrategy;
}
项目:Camel    文件:HttpTestServer.java   
/**
 * Creates a new test server.
 *
 * @param proc      the HTTP processors to be used by the server, or
 *                  <code>null</code> to use a
 *                  {@link #newProcessor default} processor
 * @param reuseStrat the connection reuse strategy to be used by the
 *                  server, or <code>null</code> to use
 *                  {@link #newConnectionReuseStrategy() default}
 *                  strategy.
 * @param params    the parameters to be used by the server, or
 *                  <code>null</code> to use
 *                  {@link #newDefaultParams default} parameters
 * @param sslcontext optional SSL context if the server is to leverage
 *                   SSL/TLS transport security
 */
public HttpTestServer(
        final BasicHttpProcessor proc,
        final ConnectionReuseStrategy reuseStrat,
        final HttpResponseFactory responseFactory,
        final HttpExpectationVerifier expectationVerifier,
        final HttpParams params,
        final SSLContext sslcontext) {
    this.handlerRegistry = new HttpRequestHandlerRegistry();
    this.workers = Collections.synchronizedSet(new HashSet<Worker>());
    this.httpservice = new HttpService(
        proc != null ? proc : newProcessor(),
        reuseStrat != null ? reuseStrat : newConnectionReuseStrategy(),
        responseFactory != null ? responseFactory : newHttpResponseFactory(),
        handlerRegistry,
        expectationVerifier,
        params != null ? params : newDefaultParams());
    this.sslcontext = sslcontext;
}
项目:purecloud-iot    文件:DefaultRequestDirector.java   
@Deprecated
public DefaultRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    this(LogFactory.getLog(DefaultRequestDirector.class),
            requestExec, conman, reustrat, kastrat, rouplan, httpProcessor, retryHandler,
            new DefaultRedirectStrategyAdaptor(redirectHandler),
            new AuthenticationStrategyAdaptor(targetAuthHandler),
            new AuthenticationStrategyAdaptor(proxyAuthHandler),
            userTokenHandler,
            params);
}
项目:purecloud-iot    文件:DefaultRequestDirector.java   
@Deprecated
public DefaultRequestDirector(
        final Log log,
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectStrategy redirectStrategy,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    this(LogFactory.getLog(DefaultRequestDirector.class),
            requestExec, conman, reustrat, kastrat, rouplan, httpProcessor, retryHandler,
            redirectStrategy,
            new AuthenticationStrategyAdaptor(targetAuthHandler),
            new AuthenticationStrategyAdaptor(proxyAuthHandler),
            userTokenHandler,
            params);
}
项目:purecloud-iot    文件:MinimalClientExec.java   
public MinimalClientExec(
        final HttpRequestExecutor requestExecutor,
        final HttpClientConnectionManager connManager,
        final ConnectionReuseStrategy reuseStrategy,
        final ConnectionKeepAliveStrategy keepAliveStrategy) {
    Args.notNull(requestExecutor, "HTTP request executor");
    Args.notNull(connManager, "Client connection manager");
    Args.notNull(reuseStrategy, "Connection reuse strategy");
    Args.notNull(keepAliveStrategy, "Connection keep alive strategy");
    this.httpProcessor = new ImmutableHttpProcessor(
            new RequestContent(),
            new RequestTargetHost(),
            new RequestClientConnControl(),
            new RequestUserAgent(VersionInfo.getUserAgent(
                    "Apache-HttpClient", "org.apache.http.client", getClass())));
    this.requestExecutor    = requestExecutor;
    this.connManager        = connManager;
    this.reuseStrategy      = reuseStrategy;
    this.keepAliveStrategy  = keepAliveStrategy;
}
项目:purecloud-iot    文件:HttpClientBuilder.java   
/**
 * Produces an instance of {@link ClientExecChain} to be used as a main exec.
 * <p>
 * Default implementation produces an instance of {@link MainClientExec}
 * </p>
 * <p>
 * For internal use.
 * </p>
 *
 * @since 4.4
 */
protected ClientExecChain createMainExec(
        final HttpRequestExecutor requestExec,
        final HttpClientConnectionManager connManager,
        final ConnectionReuseStrategy reuseStrategy,
        final ConnectionKeepAliveStrategy keepAliveStrategy,
        final HttpProcessor proxyHttpProcessor,
        final AuthenticationStrategy targetAuthStrategy,
        final AuthenticationStrategy proxyAuthStrategy,
        final UserTokenHandler userTokenHandler)
{
    return new MainClientExec(
            requestExec,
            connManager,
            reuseStrategy,
            keepAliveStrategy,
            proxyHttpProcessor,
            targetAuthStrategy,
            proxyAuthStrategy,
            userTokenHandler);
}
项目:Visit    文件:MinimalClientExec.java   
public MinimalClientExec(
        final HttpRequestExecutor requestExecutor,
        final HttpClientConnectionManager connManager,
        final ConnectionReuseStrategy reuseStrategy,
        final ConnectionKeepAliveStrategy keepAliveStrategy) {
    Args.notNull(requestExecutor, "HTTP request executor");
    Args.notNull(connManager, "Client connection manager");
    Args.notNull(reuseStrategy, "Connection reuse strategy");
    Args.notNull(keepAliveStrategy, "Connection keep alive strategy");
    this.httpProcessor = new ImmutableHttpProcessor(
            new RequestContentHC4(),
            new RequestTargetHostHC4(),
            new RequestClientConnControl(),
            new RequestUserAgentHC4(VersionInfoHC4.getUserAgent(
                    "Apache-HttpClient", "org.apache.http.client", getClass())));
    this.requestExecutor    = requestExecutor;
    this.connManager        = connManager;
    this.reuseStrategy      = reuseStrategy;
    this.keepAliveStrategy  = keepAliveStrategy;
}
项目:SoundcloudAPI    文件:ApiWrapper.java   
/** This method mainly exists to make the wrapper more testable. oh, apache's insanity. */
protected RequestDirector getRequestDirector(HttpRequestExecutor requestExec,
                                             ClientConnectionManager conman,
                                             ConnectionReuseStrategy reustrat,
                                             ConnectionKeepAliveStrategy kastrat,
                                             HttpRoutePlanner rouplan,
                                             HttpProcessor httpProcessor,
                                             HttpRequestRetryHandler retryHandler,
                                             RedirectHandler redirectHandler,
                                             AuthenticationHandler targetAuthHandler,
                                             AuthenticationHandler proxyAuthHandler,
                                             UserTokenHandler stateHandler,
                                             HttpParams params
) {
    return new DefaultRequestDirector(requestExec, conman, reustrat, kastrat, rouplan,
            httpProcessor, retryHandler, redirectHandler, targetAuthHandler, proxyAuthHandler,
            stateHandler, params);
}
项目:paperchains    文件:ApiWrapper.java   
/** This method mainly exists to make the wrapper more testable. oh, apache's insanity. */
protected RequestDirector getRequestDirector(HttpRequestExecutor requestExec,
                                             ClientConnectionManager conman,
                                             ConnectionReuseStrategy reustrat,
                                             ConnectionKeepAliveStrategy kastrat,
                                             HttpRoutePlanner rouplan,
                                             HttpProcessor httpProcessor,
                                             HttpRequestRetryHandler retryHandler,
                                             RedirectHandler redirectHandler,
                                             AuthenticationHandler targetAuthHandler,
                                             AuthenticationHandler proxyAuthHandler,
                                             UserTokenHandler stateHandler,
                                             HttpParams params
) {
    return new DefaultRequestDirector(requestExec, conman, reustrat, kastrat, rouplan,
            httpProcessor, retryHandler, redirectHandler, targetAuthHandler, proxyAuthHandler,
            stateHandler, params);
}
项目:ZTLib    文件:MinimalClientExec.java   
public MinimalClientExec(
        final HttpRequestExecutor requestExecutor,
        final HttpClientConnectionManager connManager,
        final ConnectionReuseStrategy reuseStrategy,
        final ConnectionKeepAliveStrategy keepAliveStrategy) {
    Args.notNull(requestExecutor, "HTTP request executor");
    Args.notNull(connManager, "Client connection manager");
    Args.notNull(reuseStrategy, "Connection reuse strategy");
    Args.notNull(keepAliveStrategy, "Connection keep alive strategy");
    this.httpProcessor = new ImmutableHttpProcessor(
            new RequestContentHC4(),
            new RequestTargetHostHC4(),
            new RequestClientConnControl(),
            new RequestUserAgentHC4(VersionInfoHC4.getUserAgent(
                    "Apache-HttpClient", "org.apache.http.client", getClass())));
    this.requestExecutor    = requestExecutor;
    this.connManager        = connManager;
    this.reuseStrategy      = reuseStrategy;
    this.keepAliveStrategy  = keepAliveStrategy;
}
项目:lams    文件:AbstractHttpClient.java   
/**
 * @deprecated (4.1) do not use
 */
@Deprecated
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    return new DefaultRequestDirector(
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectHandler,
            targetAuthHandler,
            proxyAuthHandler,
            userTokenHandler,
            params);
}
项目:lams    文件:AbstractHttpClient.java   
/**
 * @deprecated (4.2) do not use
 */
@Deprecated 
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectStrategy redirectStrategy,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    return new DefaultRequestDirector(
            log,
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectStrategy,
            targetAuthHandler,
            proxyAuthHandler,
            userTokenHandler,
            params);
}
项目:lams    文件:AbstractHttpClient.java   
/**
 * @since 4.2
 */
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectStrategy redirectStrategy,
        final AuthenticationStrategy targetAuthStrategy,
        final AuthenticationStrategy proxyAuthStrategy,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    return new DefaultRequestDirector(
            log,
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectStrategy,
            targetAuthStrategy,
            proxyAuthStrategy,
            userTokenHandler,
            params);
}
项目:lams    文件:SystemDefaultHttpClient.java   
@Override
protected ConnectionReuseStrategy createConnectionReuseStrategy() {
    String s = System.getProperty("http.keepAlive");
    if ("true".equalsIgnoreCase(s)) {
        return new DefaultConnectionReuseStrategy();
    } else {
        return new NoConnectionReuseStrategy();
    }
}
项目:lams    文件:HttpService.java   
/**
 * Create a new HTTP service.
 *
 * @param processor            the processor to use on requests and responses
 * @param connStrategy         the connection reuse strategy
 * @param responseFactory      the response factory
 * @param handlerResolver      the handler resolver. May be null.
 * @param expectationVerifier  the expectation verifier. May be null.
 * @param params               the HTTP parameters
 *
 * @since 4.1
 */
public HttpService(
        final HttpProcessor processor,
        final ConnectionReuseStrategy connStrategy,
        final HttpResponseFactory responseFactory,
        final HttpRequestHandlerResolver handlerResolver,
        final HttpExpectationVerifier expectationVerifier,
        final HttpParams params) {
    super();
    if (processor == null) {
        throw new IllegalArgumentException("HTTP processor may not be null");
    }
    if (connStrategy == null) {
        throw new IllegalArgumentException("Connection reuse strategy may not be null");
    }
    if (responseFactory == null) {
        throw new IllegalArgumentException("Response factory may not be null");
    }
    if (params == null) {
        throw new IllegalArgumentException("HTTP parameters may not be null");
    }
    this.processor = processor;
    this.connStrategy = connStrategy;
    this.responseFactory = responseFactory;
    this.handlerResolver = handlerResolver;
    this.expectationVerifier = expectationVerifier;
    this.params = params;
}
项目:lams    文件:HttpService.java   
/**
 * Create a new HTTP service.
 *
 * @param proc             the processor to use on requests and responses
 * @param connStrategy     the connection reuse strategy
 * @param responseFactory  the response factory
 *
 * @deprecated (4.1) use {@link HttpService#HttpService(HttpProcessor,
 *  ConnectionReuseStrategy, HttpResponseFactory, HttpRequestHandlerResolver, HttpParams)}
 */
@Deprecated
public HttpService(
        final HttpProcessor proc,
        final ConnectionReuseStrategy connStrategy,
        final HttpResponseFactory responseFactory) {
    super();
    setHttpProcessor(proc);
    setConnReuseStrategy(connStrategy);
    setResponseFactory(responseFactory);
}
项目:lams    文件:HttpService.java   
/**
 * @deprecated (4.1) set {@link ConnectionReuseStrategy} using constructor
 */
@Deprecated
public void setConnReuseStrategy(final ConnectionReuseStrategy connStrategy) {
    if (connStrategy == null) {
        throw new IllegalArgumentException("Connection reuse strategy may not be null");
    }
    this.connStrategy = connStrategy;
}
项目:yaacc-code    文件:YaaccHttpService.java   
public YaaccHttpService(HttpProcessor proc,
                        ConnectionReuseStrategy connStrategy,
                        HttpResponseFactory responseFactory, Context context) {
    super(proc, connStrategy, responseFactory);
    this.context = context;

}
项目:PhET    文件:NHttpReverseProxy.java   
public ListeningHandler(
        final HttpHost targetHost,
        final ConnectingIOReactor connectingIOReactor,
        final HttpProcessor httpProcessor, 
        final HttpResponseFactory responseFactory,
        final ConnectionReuseStrategy connStrategy,
        final HttpParams params) {
    super();
    this.targetHost = targetHost;
    this.connectingIOReactor = connectingIOReactor;
    this.httpProcessor = httpProcessor;
    this.connStrategy = connStrategy;
    this.responseFactory = responseFactory;
    this.params = params;
}
项目:PhET    文件:NHttpReverseProxy.java   
public ConnectingHandler(
        final HttpProcessor httpProcessor, 
        final ConnectionReuseStrategy connStrategy,
        final HttpParams params) {
    super();
    this.httpProcessor = httpProcessor;
    this.connStrategy = connStrategy;
    this.params = params;
}
项目:remote-files-sync    文件:MainClientExec.java   
public MainClientExec(
        final HttpRequestExecutor requestExecutor,
        final HttpClientConnectionManager connManager,
        final ConnectionReuseStrategy reuseStrategy,
        final ConnectionKeepAliveStrategy keepAliveStrategy,
        final AuthenticationStrategy targetAuthStrategy,
        final AuthenticationStrategy proxyAuthStrategy,
        final UserTokenHandler userTokenHandler) {
    Args.notNull(requestExecutor, "HTTP request executor");
    Args.notNull(connManager, "Client connection manager");
    Args.notNull(reuseStrategy, "Connection reuse strategy");
    Args.notNull(keepAliveStrategy, "Connection keep alive strategy");
    Args.notNull(targetAuthStrategy, "Target authentication strategy");
    Args.notNull(proxyAuthStrategy, "Proxy authentication strategy");
    Args.notNull(userTokenHandler, "User token handler");
    this.authenticator      = new HttpAuthenticator();
    this.proxyHttpProcessor = new ImmutableHttpProcessor(
            new RequestTargetHostHC4(), new RequestClientConnControl());
    this.routeDirector      = new BasicRouteDirector();
    this.requestExecutor    = requestExecutor;
    this.connManager        = connManager;
    this.reuseStrategy      = reuseStrategy;
    this.keepAliveStrategy  = keepAliveStrategy;
    this.targetAuthStrategy = targetAuthStrategy;
    this.proxyAuthStrategy  = proxyAuthStrategy;
    this.userTokenHandler   = userTokenHandler;
}
项目:java-binrepo-proxy    文件:HttpCoreTransportClientImpl.java   
public HttpCoreTransportClientImpl(HttpRequestExecutor httpexecutor, HttpProcessor httpproc, ConnectionReuseStrategy connStrategy, final HttpClientConnection conn, final HttpRequest request,
            final HttpResponse response,
            final HttpContext context) {
    this.httpexecutor = httpexecutor;
    this.httpproc = httpproc;
    this.connStrategy = connStrategy;
    this.conn = conn;
    this.request = request;
    this.response = response;
    this.context = context;
}
项目:purecloud-iot    文件:AbstractHttpClient.java   
/**
 * @deprecated (4.1) do not use
 */
@Deprecated
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    return new DefaultRequestDirector(
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectHandler,
            targetAuthHandler,
            proxyAuthHandler,
            userTokenHandler,
            params);
}
项目:purecloud-iot    文件:AbstractHttpClient.java   
/**
 * @deprecated (4.2) do not use
 */
@Deprecated
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectStrategy redirectStrategy,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    return new DefaultRequestDirector(
            log,
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectStrategy,
            targetAuthHandler,
            proxyAuthHandler,
            userTokenHandler,
            params);
}
项目:purecloud-iot    文件:AbstractHttpClient.java   
/**
 * @since 4.2
 */
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectStrategy redirectStrategy,
        final AuthenticationStrategy targetAuthStrategy,
        final AuthenticationStrategy proxyAuthStrategy,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    return new DefaultRequestDirector(
            log,
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectStrategy,
            targetAuthStrategy,
            proxyAuthStrategy,
            userTokenHandler,
            params);
}
项目:purecloud-iot    文件:SystemDefaultHttpClient.java   
@Override
protected ConnectionReuseStrategy createConnectionReuseStrategy() {
    final String s = System.getProperty("http.keepAlive", "true");
    if ("true".equalsIgnoreCase(s)) {
        return new DefaultConnectionReuseStrategy();
    } else {
        return new NoConnectionReuseStrategy();
    }
}
项目:purecloud-iot    文件:MainClientExec.java   
/**
 * @since 4.4
 */
public MainClientExec(
        final HttpRequestExecutor requestExecutor,
        final HttpClientConnectionManager connManager,
        final ConnectionReuseStrategy reuseStrategy,
        final ConnectionKeepAliveStrategy keepAliveStrategy,
        final HttpProcessor proxyHttpProcessor,
        final AuthenticationStrategy targetAuthStrategy,
        final AuthenticationStrategy proxyAuthStrategy,
        final UserTokenHandler userTokenHandler) {
    Args.notNull(requestExecutor, "HTTP request executor");
    Args.notNull(connManager, "Client connection manager");
    Args.notNull(reuseStrategy, "Connection reuse strategy");
    Args.notNull(keepAliveStrategy, "Connection keep alive strategy");
    Args.notNull(proxyHttpProcessor, "Proxy HTTP processor");
    Args.notNull(targetAuthStrategy, "Target authentication strategy");
    Args.notNull(proxyAuthStrategy, "Proxy authentication strategy");
    Args.notNull(userTokenHandler, "User token handler");
    this.authenticator      = new HttpAuthenticator();
    this.routeDirector      = new BasicRouteDirector();
    this.requestExecutor    = requestExecutor;
    this.connManager        = connManager;
    this.reuseStrategy      = reuseStrategy;
    this.keepAliveStrategy  = keepAliveStrategy;
    this.proxyHttpProcessor = proxyHttpProcessor;
    this.targetAuthStrategy = targetAuthStrategy;
    this.proxyAuthStrategy  = proxyAuthStrategy;
    this.userTokenHandler   = userTokenHandler;
}
项目:purecloud-iot    文件:MainClientExec.java   
public MainClientExec(
        final HttpRequestExecutor requestExecutor,
        final HttpClientConnectionManager connManager,
        final ConnectionReuseStrategy reuseStrategy,
        final ConnectionKeepAliveStrategy keepAliveStrategy,
        final AuthenticationStrategy targetAuthStrategy,
        final AuthenticationStrategy proxyAuthStrategy,
        final UserTokenHandler userTokenHandler) {
    this(requestExecutor, connManager, reuseStrategy, keepAliveStrategy,
            new ImmutableHttpProcessor(new RequestTargetHost()),
            targetAuthStrategy, proxyAuthStrategy, userTokenHandler);
}
项目:FMTech    文件:AndroidHttpClient.java   
private AndroidHttpClient(ClientConnectionManager paramClientConnectionManager, HttpParams paramHttpParams)
{
  this.delegate = new DefaultHttpClient(paramClientConnectionManager, paramHttpParams)
  {
    protected final RequestDirector createClientRequestDirector(HttpRequestExecutor paramAnonymousHttpRequestExecutor, ClientConnectionManager paramAnonymousClientConnectionManager, ConnectionReuseStrategy paramAnonymousConnectionReuseStrategy, ConnectionKeepAliveStrategy paramAnonymousConnectionKeepAliveStrategy, HttpRoutePlanner paramAnonymousHttpRoutePlanner, HttpProcessor paramAnonymousHttpProcessor, HttpRequestRetryHandler paramAnonymousHttpRequestRetryHandler, RedirectHandler paramAnonymousRedirectHandler, AuthenticationHandler paramAnonymousAuthenticationHandler1, AuthenticationHandler paramAnonymousAuthenticationHandler2, UserTokenHandler paramAnonymousUserTokenHandler, HttpParams paramAnonymousHttpParams)
    {
      return new ElegantRequestDirector(paramAnonymousHttpRequestExecutor, paramAnonymousClientConnectionManager, paramAnonymousConnectionReuseStrategy, paramAnonymousConnectionKeepAliveStrategy, paramAnonymousHttpRoutePlanner, paramAnonymousHttpProcessor, paramAnonymousHttpRequestRetryHandler, paramAnonymousRedirectHandler, paramAnonymousAuthenticationHandler1, paramAnonymousAuthenticationHandler2, paramAnonymousUserTokenHandler, paramAnonymousHttpParams);
    }

    protected final HttpContext createHttpContext()
    {
      BasicHttpContext localBasicHttpContext = new BasicHttpContext();
      localBasicHttpContext.setAttribute("http.authscheme-registry", getAuthSchemes());
      localBasicHttpContext.setAttribute("http.cookiespec-registry", getCookieSpecs());
      localBasicHttpContext.setAttribute("http.auth.credentials-provider", getCredentialsProvider());
      return localBasicHttpContext;
    }

    protected final BasicHttpProcessor createHttpProcessor()
    {
      BasicHttpProcessor localBasicHttpProcessor = super.createHttpProcessor();
      localBasicHttpProcessor.addRequestInterceptor(AndroidHttpClient.sThreadCheckInterceptor);
      localBasicHttpProcessor.addRequestInterceptor(new AndroidHttpClient.CurlLogger(AndroidHttpClient.this, (byte)0));
      return localBasicHttpProcessor;
    }
  };
}
项目:Visit    文件:MainClientExec.java   
public MainClientExec(
        final HttpRequestExecutor requestExecutor,
        final HttpClientConnectionManager connManager,
        final ConnectionReuseStrategy reuseStrategy,
        final ConnectionKeepAliveStrategy keepAliveStrategy,
        final AuthenticationStrategy targetAuthStrategy,
        final AuthenticationStrategy proxyAuthStrategy,
        final UserTokenHandler userTokenHandler) {
    Args.notNull(requestExecutor, "HTTP request executor");
    Args.notNull(connManager, "Client connection manager");
    Args.notNull(reuseStrategy, "Connection reuse strategy");
    Args.notNull(keepAliveStrategy, "Connection keep alive strategy");
    Args.notNull(targetAuthStrategy, "Target authentication strategy");
    Args.notNull(proxyAuthStrategy, "Proxy authentication strategy");
    Args.notNull(userTokenHandler, "User token handler");
    this.authenticator      = new HttpAuthenticator();
    this.proxyHttpProcessor = new ImmutableHttpProcessor(
            new RequestTargetHostHC4(), new RequestClientConnControl());
    this.routeDirector      = new BasicRouteDirector();
    this.requestExecutor    = requestExecutor;
    this.connManager        = connManager;
    this.reuseStrategy      = reuseStrategy;
    this.keepAliveStrategy  = keepAliveStrategy;
    this.targetAuthStrategy = targetAuthStrategy;
    this.proxyAuthStrategy  = proxyAuthStrategy;
    this.userTokenHandler   = userTokenHandler;
}
项目:rxp-remote-java    文件:HttpUtils.java   
/**
 * Get a default HttpClient based on the HttpConfiguration object. If required the defaults can 
 * be altered to meet the requirements of the SDK user. The default client does not use connection 
 * pooling and does not reuse connections. Timeouts for connection and socket are taken from the 
 * {@link HttpConfiguration} object.
 * 
 * @param httpConfiguration
 * @return CloseableHttpClient
 */
public static CloseableHttpClient getDefaultClient(HttpConfiguration httpConfiguration) {

    RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(httpConfiguration.getTimeout())
            .setSocketTimeout(httpConfiguration.getTimeout()).build();

    HttpClientConnectionManager connectionManager = new BasicHttpClientConnectionManager();
    ConnectionReuseStrategy connectionResuseStrategy = new NoConnectionReuseStrategy();

    logger.debug("Creating HttpClient with simple no pooling/no connection reuse default settings.");
    CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig).setConnectionManager(connectionManager)
            .setConnectionReuseStrategy(connectionResuseStrategy).build();
    return httpClient;
}
项目:log4all-client-java    文件:Log4AllClient.java   
private HttpClient getHttpClient() {
    DefaultHttpClient client = new DefaultHttpClient();
    client.setReuseStrategy(new ConnectionReuseStrategy() {
        @Override
        public boolean keepAlive(HttpResponse httpResponse, HttpContext httpContext) {
            return false;
        }
    });
    return client;
}
项目:FullRobolectricTestSample    文件:ShadowDefaultRequestDirector.java   
public void __constructor__(
    HttpRequestExecutor requestExec,
    ClientConnectionManager conman,
    ConnectionReuseStrategy reustrat,
    ConnectionKeepAliveStrategy kastrat,
    HttpRoutePlanner rouplan,
    HttpProcessor httpProcessor,
    HttpRequestRetryHandler retryHandler,
    RedirectHandler redirectHandler,
    AuthenticationHandler targetAuthHandler,
    AuthenticationHandler proxyAuthHandler,
    UserTokenHandler userTokenHandler,
    HttpParams params) {
  __constructor__(
      LogFactory.getLog(DefaultRequestDirector.class),
      requestExec,
      conman,
      reustrat,
      kastrat,
      rouplan,
      httpProcessor,
      retryHandler,
      redirectHandler,
      targetAuthHandler,
      proxyAuthHandler,
      userTokenHandler,
      params);
}
项目:FullRobolectricTestSample    文件:DefaultRequestDirector.java   
public DefaultRequestDirector(
    final HttpRequestExecutor requestExec,
    final ClientConnectionManager conman,
    final ConnectionReuseStrategy reustrat,
    final ConnectionKeepAliveStrategy kastrat,
    final HttpRoutePlanner rouplan,
    final HttpProcessor httpProcessor,
    final HttpRequestRetryHandler retryHandler,
    final RedirectHandler redirectHandler,
    final AuthenticationHandler targetAuthHandler,
    final AuthenticationHandler proxyAuthHandler,
    final UserTokenHandler userTokenHandler,
    final HttpParams params) {
  this(LogFactory.getLog(DefaultRequestDirector.class),
      requestExec,
      conman,
      reustrat,
      kastrat,
      rouplan,
      httpProcessor,
      retryHandler,
      redirectHandler,
      targetAuthHandler,
      proxyAuthHandler,
      userTokenHandler,
      params);

}
项目:cJUnit-mc626    文件:AbstractHttpClient.java   
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler stateHandler,
        final HttpParams params) {
    return new DefaultRequestDirector(
            log,
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectHandler,
            targetAuthHandler,
            proxyAuthHandler,
            stateHandler,
            params);
}
项目:cJUnit-mc626    文件:DefaultRequestDirector.java   
public DefaultRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    this(LogFactory.getLog(DefaultRequestDirector.class),
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectHandler,
            targetAuthHandler,
            proxyAuthHandler,
            userTokenHandler,
            params);

}
项目:wso2-axis2    文件:AxisHttpService.java   
public AxisHttpService(
        final HttpProcessor httpProcessor,
        final ConnectionReuseStrategy connStrategy,
        final HttpResponseFactory responseFactory,
        final ConfigurationContext configurationContext,
        final Worker worker) {
    super();
    if (httpProcessor == null) {
        throw new IllegalArgumentException("HTTP processor may not be null");
    }
    if (connStrategy == null) {
        throw new IllegalArgumentException("Connection strategy may not be null");
    }
    if (responseFactory == null) {
        throw new IllegalArgumentException("Response factory may not be null");
    }
    if (worker == null) {
        throw new IllegalArgumentException("Worker may not be null");
    }
    if (configurationContext == null) {
        throw new IllegalArgumentException("Configuration context may not be null");
    }
    this.httpProcessor = httpProcessor;
    this.connStrategy = connStrategy;
    this.responseFactory = responseFactory;
    this.configurationContext = configurationContext;
    this.worker = worker;

}
项目:MAKEYOURFACE    文件:HttpService.java   
/**
 * Create a new HTTP service.
 *
 * @param processor            the processor to use on requests and responses
 * @param connStrategy         the connection reuse strategy
 * @param responseFactory      the response factory
 * @param handlerResolver      the handler resolver. May be null.
 * @param expectationVerifier  the expectation verifier. May be null.
 * @param params               the HTTP parameters
 *
 * @since 4.1
 */
public HttpService(
        final HttpProcessor processor,
        final ConnectionReuseStrategy connStrategy,
        final HttpResponseFactory responseFactory,
        final HttpRequestHandlerResolver handlerResolver,
        final HttpExpectationVerifier expectationVerifier,
        final HttpParams params) {
    super();
    if (processor == null) {
        throw new IllegalArgumentException("HTTP processor may not be null");
    }
    if (connStrategy == null) {
        throw new IllegalArgumentException("Connection reuse strategy may not be null");
    }
    if (responseFactory == null) {
        throw new IllegalArgumentException("Response factory may not be null");
    }
    if (params == null) {
        throw new IllegalArgumentException("HTTP parameters may not be null");
    }
    this.processor = processor;
    this.connStrategy = connStrategy;
    this.responseFactory = responseFactory;
    this.handlerResolver = handlerResolver;
    this.expectationVerifier = expectationVerifier;
    this.params = params;
}