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


Java ConnectionConfig.DEFAULT属性代码示例

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


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

示例1: ProxyClient

/**
 * @since 4.3
 */
public ProxyClient(
        final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
        final ConnectionConfig connectionConfig,
        final RequestConfig requestConfig) {
    super();
    this.connFactory = connFactory != null ? connFactory : ManagedHttpClientConnectionFactory.INSTANCE;
    this.connectionConfig = connectionConfig != null ? connectionConfig : ConnectionConfig.DEFAULT;
    this.requestConfig = requestConfig != null ? requestConfig : RequestConfig.DEFAULT;
    this.httpProcessor = new ImmutableHttpProcessor(
            new RequestTargetHostHC4(), new RequestClientConnControl(), new RequestUserAgentHC4());
    this.requestExec = new HttpRequestExecutor();
    this.proxyAuthStrategy = new ProxyAuthenticationStrategy();
    this.authenticator = new HttpAuthenticator();
    this.proxyAuthState = new AuthStateHC4();
    this.authSchemeRegistry = new AuthSchemeRegistry();
    this.authSchemeRegistry.register(AuthSchemes.BASIC, new BasicSchemeFactoryHC4());
    this.authSchemeRegistry.register(AuthSchemes.DIGEST, new DigestSchemeFactoryHC4());
    this.authSchemeRegistry.register(AuthSchemes.NTLM, new NTLMSchemeFactory());
    this.reuseStrategy = new DefaultConnectionReuseStrategyHC4();
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:23,代码来源:ProxyClient.java

示例2: create

public ManagedHttpClientConnection create(final HttpRoute route) throws IOException {
    ConnectionConfig config = null;
    if (route.getProxyHost() != null) {
        config = this.configData.getConnectionConfig(route.getProxyHost());
    }
    if (config == null) {
        config = this.configData.getConnectionConfig(route.getTargetHost());
    }
    if (config == null) {
        config = this.configData.getDefaultConnectionConfig();
    }
    if (config == null) {
        config = ConnectionConfig.DEFAULT;
    }
    return this.connFactory.create(route, config);
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:16,代码来源:PoolingHttpClientConnectionManager.java

示例3: ProxyClient

/**
 * @since 4.3
 */
public ProxyClient(
        final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
        final ConnectionConfig connectionConfig,
        final RequestConfig requestConfig) {
    super();
    this.connFactory = connFactory != null ? connFactory : ManagedHttpClientConnectionFactory.INSTANCE;
    this.connectionConfig = connectionConfig != null ? connectionConfig : ConnectionConfig.DEFAULT;
    this.requestConfig = requestConfig != null ? requestConfig : RequestConfig.DEFAULT;
    this.httpProcessor = new ImmutableHttpProcessor(
            new RequestTargetHost(), new RequestClientConnControl(), new RequestUserAgent());
    this.requestExec = new HttpRequestExecutor();
    this.proxyAuthStrategy = new ProxyAuthenticationStrategy();
    this.authenticator = new HttpAuthenticator();
    this.proxyAuthState = new AuthState();
    this.authSchemeRegistry = new AuthSchemeRegistry();
    this.authSchemeRegistry.register(AuthSchemes.BASIC, new BasicSchemeFactory());
    this.authSchemeRegistry.register(AuthSchemes.DIGEST, new DigestSchemeFactory());
    this.authSchemeRegistry.register(AuthSchemes.NTLM, new NTLMSchemeFactory());
    this.authSchemeRegistry.register(AuthSchemes.SPNEGO, new SPNegoSchemeFactory());
    this.authSchemeRegistry.register(AuthSchemes.KERBEROS, new KerberosSchemeFactory());
    this.reuseStrategy = new DefaultConnectionReuseStrategy();
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:25,代码来源:ProxyClient.java

示例4: create

@Override
public ManagedHttpClientConnection create(final HttpRoute route) throws IOException {
    ConnectionConfig config = null;
    if (route.getProxyHost() != null) {
        config = this.configData.getConnectionConfig(route.getProxyHost());
    }
    if (config == null) {
        config = this.configData.getConnectionConfig(route.getTargetHost());
    }
    if (config == null) {
        config = this.configData.getDefaultConnectionConfig();
    }
    if (config == null) {
        config = ConnectionConfig.DEFAULT;
    }
    return this.connFactory.create(route, config);
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:17,代码来源:PoolingHttpClientConnectionManager.java

示例5: SimpleHttpClient

public SimpleHttpClient()
{
	ConnectionConfig config = ConnectionConfig.DEFAULT;
	RequestConfig requestConfig = RequestConfig.custom()
			.setConnectTimeout(3000)
			.setConnectionRequestTimeout(3000)
			.build();
	
	HttpClientBuilder builder = HttpClientBuilder.create();
	builder.setDefaultConnectionConfig(config);
	builder.setDefaultRequestConfig(requestConfig);
	
	client = builder.build();
	httpClientContext = HttpClientContext.create();
}
 
开发者ID:LinuxSuRen,项目名称:phoenix.interface.framework,代码行数:15,代码来源:SimpleHttpClient.java

示例6: BasicConnFactory

/**
 * @since 4.3
 */
public BasicConnFactory(
        final SocketFactory plainfactory,
        final SSLSocketFactory sslfactory,
        final int connectTimeout,
        final SocketConfig sconfig,
        final ConnectionConfig cconfig) {
    super();
    this.plainfactory = plainfactory;
    this.sslfactory = sslfactory;
    this.connectTimeout = connectTimeout;
    this.sconfig = sconfig != null ? sconfig : SocketConfig.DEFAULT;
    this.connFactory = new DefaultBHttpClientConnectionFactory(
            cconfig != null ? cconfig : ConnectionConfig.DEFAULT);
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:17,代码来源:BasicConnFactory.java

示例7: DefaultBHttpClientConnectionFactory

public DefaultBHttpClientConnectionFactory(
        final ConnectionConfig cconfig,
        final ContentLengthStrategy incomingContentStrategy,
        final ContentLengthStrategy outgoingContentStrategy,
        final HttpMessageWriterFactory<HttpRequest> requestWriterFactory,
        final HttpMessageParserFactory<HttpResponse> responseParserFactory) {
    super();
    this.cconfig = cconfig != null ? cconfig : ConnectionConfig.DEFAULT;
    this.incomingContentStrategy = incomingContentStrategy;
    this.outgoingContentStrategy = outgoingContentStrategy;
    this.requestWriterFactory = requestWriterFactory;
    this.responseParserFactory = responseParserFactory;
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:13,代码来源:DefaultBHttpClientConnectionFactory.java

示例8: create

public ManagedHttpClientConnection create(final HttpRoute route, final ConnectionConfig config) {
    final ConnectionConfig cconfig = config != null ? config : ConnectionConfig.DEFAULT;
    CharsetDecoder chardecoder = null;
    CharsetEncoder charencoder = null;
    final Charset charset = cconfig.getCharset();
    final CodingErrorAction malformedInputAction = cconfig.getMalformedInputAction() != null ?
            cconfig.getMalformedInputAction() : CodingErrorAction.REPORT;
    final CodingErrorAction unmappableInputAction = cconfig.getUnmappableInputAction() != null ?
            cconfig.getUnmappableInputAction() : CodingErrorAction.REPORT;
    if (charset != null) {
        chardecoder = charset.newDecoder();
        chardecoder.onMalformedInput(malformedInputAction);
        chardecoder.onUnmappableCharacter(unmappableInputAction);
        charencoder = charset.newEncoder();
        charencoder.onMalformedInput(malformedInputAction);
        charencoder.onUnmappableCharacter(unmappableInputAction);
    }
    final String id = "http-outgoing-" + Long.toString(COUNTER.getAndIncrement());
    return new LoggingManagedHttpClientConnection(
            id,
            cconfig.getBufferSize(),
            cconfig.getFragmentSizeHint(),
            chardecoder,
            charencoder,
            cconfig.getMessageConstraints(),
            null,
            null,
            requestWriterFactory,
            responseParserFactory);
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:30,代码来源:ManagedHttpClientConnectionFactory.java

示例9: BasicHttpClientConnectionManager

public BasicHttpClientConnectionManager(
        final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
        final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver) {
    super();
    this.connectionOperator = new HttpClientConnectionOperator(
            socketFactoryRegistry, schemePortResolver, dnsResolver);
    this.connFactory = connFactory != null ? connFactory : ManagedHttpClientConnectionFactory.INSTANCE;
    this.expiry = Long.MAX_VALUE;
    this.socketConfig = SocketConfig.DEFAULT;
    this.connConfig = ConnectionConfig.DEFAULT;
    this.isShutdown = new AtomicBoolean(false);
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:14,代码来源:BasicHttpClientConnectionManager.java

示例10: DefaultBHttpServerConnectionFactory

public DefaultBHttpServerConnectionFactory(
        final ConnectionConfig cconfig,
        final ContentLengthStrategy incomingContentStrategy,
        final ContentLengthStrategy outgoingContentStrategy,
        final HttpMessageParserFactory<HttpRequest> requestParserFactory,
        final HttpMessageWriterFactory<HttpResponse> responseWriterFactory) {
    super();
    this.cconfig = cconfig != null ? cconfig : ConnectionConfig.DEFAULT;
    this.incomingContentStrategy = incomingContentStrategy;
    this.outgoingContentStrategy = outgoingContentStrategy;
    this.requestParserFactory = requestParserFactory;
    this.responseWriterFactory = responseWriterFactory;
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:13,代码来源:DefaultBHttpServerConnectionFactory.java

示例11: create

@Override
public ManagedHttpClientConnection create(final HttpRoute route, final ConnectionConfig config) {
    final ConnectionConfig cconfig = config != null ? config : ConnectionConfig.DEFAULT;
    CharsetDecoder chardecoder = null;
    CharsetEncoder charencoder = null;
    final Charset charset = cconfig.getCharset();
    final CodingErrorAction malformedInputAction = cconfig.getMalformedInputAction() != null ?
            cconfig.getMalformedInputAction() : CodingErrorAction.REPORT;
    final CodingErrorAction unmappableInputAction = cconfig.getUnmappableInputAction() != null ?
            cconfig.getUnmappableInputAction() : CodingErrorAction.REPORT;
    if (charset != null) {
        chardecoder = charset.newDecoder();
        chardecoder.onMalformedInput(malformedInputAction);
        chardecoder.onUnmappableCharacter(unmappableInputAction);
        charencoder = charset.newEncoder();
        charencoder.onMalformedInput(malformedInputAction);
        charencoder.onUnmappableCharacter(unmappableInputAction);
    }
    final String id = "http-outgoing-" + Long.toString(COUNTER.getAndIncrement());
    return new LoggingManagedHttpClientConnection(
            id,
            log,
            headerlog,
            wirelog,
            cconfig.getBufferSize(),
            cconfig.getFragmentSizeHint(),
            chardecoder,
            charencoder,
            cconfig.getMessageConstraints(),
            incomingContentStrategy,
            outgoingContentStrategy,
            requestWriterFactory,
            responseParserFactory);
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:34,代码来源:ManagedHttpClientConnectionFactory.java

示例12: BasicHttpClientConnectionManager

/**
 * @since 4.4
 */
public BasicHttpClientConnectionManager(
        final HttpClientConnectionOperator httpClientConnectionOperator,
        final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory) {
    super();
    this.connectionOperator = Args.notNull(httpClientConnectionOperator, "Connection operator");
    this.connFactory = connFactory != null ? connFactory : ManagedHttpClientConnectionFactory.INSTANCE;
    this.expiry = Long.MAX_VALUE;
    this.socketConfig = SocketConfig.DEFAULT;
    this.connConfig = ConnectionConfig.DEFAULT;
    this.isShutdown = new AtomicBoolean(false);
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:14,代码来源:BasicHttpClientConnectionManager.java

示例13: OppoMessenger

@SuppressFBWarnings("RV_RETURN_VALUE_IGNORED")
public OppoMessenger(final String remoteHost, final int remotePort, final int localPort,
                     final HttpClientService httpClient)
        throws IOException {
    this.httpClient = httpClient;

    // Set up the server
    final HttpProcessor processor = HttpProcessorBuilder.create()
            .add(new ResponseContent())
            .add(new ResponseContentEncoding())
            .add(new ResponseConnControl())
            .build();

    final HttpAsyncService service = new HttpAsyncService(processor, mapper);
    final NHttpConnectionFactory<DefaultNHttpServerConnection> connectionFactory = new DefaultNHttpServerConnectionFactory(ConnectionConfig.DEFAULT);
    final IOEventDispatch dispatch = new DefaultHttpServerIODispatch(service, connectionFactory);

    server = new DefaultListeningIOReactor(IOReactorConfig.DEFAULT);
    server.listen(new InetSocketAddress(localPort));

    new Thread(new Runnable() {
        @Override public void run() {
            try {
                server.execute(dispatch);
            } catch (final IOException e) {
                logger().level(Error).message("HTTP server failed").error(e).log();
            }
        }
    }, "Oppo HTTP server");

    // Set up the client
    deviceUrlBase = "http://" + remoteHost + ':' + remotePort + '/';
}
 
开发者ID:markmckenna,项目名称:LibOppo,代码行数:33,代码来源:OppoMessenger.java

示例14: BasicConnPool

/**
 * @since 4.3
 */
public BasicConnPool() {
    super(new BasicConnFactory(SocketConfig.DEFAULT, ConnectionConfig.DEFAULT), 2, 20);
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:6,代码来源:BasicConnPool.java

示例15: setConnectionConfig

public synchronized void setConnectionConfig(final ConnectionConfig connConfig) {
    this.connConfig = connConfig != null ? connConfig : ConnectionConfig.DEFAULT;
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:3,代码来源:BasicHttpClientConnectionManager.java


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