• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java SchemePortResolver类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.apache.http.conn.SchemePortResolver的典型用法代码示例。如果您正苦于以下问题:Java SchemePortResolver类的具体用法?Java SchemePortResolver怎么用?Java SchemePortResolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

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

示例1: BasicAuthCache

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
/**
 * Default constructor.
 *
 * @since 4.3
 */
public BasicAuthCache(final SchemePortResolver schemePortResolver) {
    super();
    this.map = new HashMap<HttpHost, AuthScheme>();
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
}
 

开发者ID:xxonehjh,
项目名称:remote-files-sync,
代码行数:12,
代码来源:BasicAuthCache.java

示例2: HttpClientConnectionOperator

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
HttpClientConnectionOperator(
        final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver) {
    super();
    Args.notNull(socketFactoryRegistry, "Socket factory registry");
    this.socketFactoryRegistry = socketFactoryRegistry;
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
    this.dnsResolver = dnsResolver != null ? dnsResolver :
        SystemDefaultDnsResolver.INSTANCE;
}
 

开发者ID:xxonehjh,
项目名称:remote-files-sync,
代码行数:13,
代码来源:HttpClientConnectionOperator.java

示例3: BasicHttpClientConnectionManager

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
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,
代码行数:15,
代码来源:BasicHttpClientConnectionManager.java

示例4: PoolingHttpClientConnectionManager

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
public PoolingHttpClientConnectionManager(
        final Registry<ConnectionSocketFactory> socketFactoryRegistry,
        final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver,
        final long timeToLive, final TimeUnit tunit) {
    super();
    this.configData = new ConfigData();
    this.pool = new CPool(
            new InternalConnectionFactory(this.configData, connFactory), 2, 20, timeToLive, tunit);
    this.connectionOperator = new HttpClientConnectionOperator(
            socketFactoryRegistry, schemePortResolver, dnsResolver);
    this.isShutDown = new AtomicBoolean(false);
}
 

开发者ID:xxonehjh,
项目名称:remote-files-sync,
代码行数:15,
代码来源:PoolingHttpClientConnectionManager.java

示例5: BasicAuthCache

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
/**
 * Default constructor.
 *
 * @since 4.3
 */
public BasicAuthCache(final SchemePortResolver schemePortResolver) {
    super();
    this.map = new ConcurrentHashMap<HttpHost, byte[]>();
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
}
 

开发者ID:MyPureCloud,
项目名称:purecloud-iot,
代码行数:12,
代码来源:BasicAuthCache.java

示例6: BasicHttpClientConnectionManager

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
public BasicHttpClientConnectionManager(
    final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
    final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
    final SchemePortResolver schemePortResolver,
    final DnsResolver dnsResolver) {
  this(
      new DefaultHttpClientConnectionOperator(socketFactoryRegistry, schemePortResolver, dnsResolver),
      connFactory
  );
}
 

开发者ID:MyPureCloud,
项目名称:purecloud-iot,
代码行数:11,
代码来源:BasicHttpClientConnectionManager.java

示例7: PoolingHttpClientConnectionManager

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
public PoolingHttpClientConnectionManager(
        final Registry<ConnectionSocketFactory> socketFactoryRegistry,
        final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver,
        final long timeToLive, final TimeUnit tunit) {
    this(
        new DefaultHttpClientConnectionOperator(socketFactoryRegistry, schemePortResolver, dnsResolver),
        connFactory,
        timeToLive, tunit
    );
}
 

开发者ID:MyPureCloud,
项目名称:purecloud-iot,
代码行数:13,
代码来源:PoolingHttpClientConnectionManager.java

示例8: DefaultHttpClientConnectionOperator

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
public DefaultHttpClientConnectionOperator(
        final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver) {
    super();
    Args.notNull(socketFactoryRegistry, "Socket factory registry");
    this.socketFactoryRegistry = socketFactoryRegistry;
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
    this.dnsResolver = dnsResolver != null ? dnsResolver :
        SystemDefaultDnsResolver.INSTANCE;
}
 

开发者ID:MyPureCloud,
项目名称:purecloud-iot,
代码行数:13,
代码来源:DefaultHttpClientConnectionOperator.java

示例9: testGetKeyWithSchemeRegistry

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
@Test
public void testGetKeyWithSchemeRegistry() throws Exception {
    final SchemePortResolver schemePortResolver = Mockito.mock(SchemePortResolver.class);
    final BasicAuthCache cache = new BasicAuthCache(schemePortResolver);
    Mockito.when(schemePortResolver.resolve(new HttpHost("localhost", -1, "https"))).thenReturn(443);
    final HttpHost target = new HttpHost("localhost", 443, "https");
    Assert.assertSame(target, cache.getKey(target));
    Assert.assertEquals(target, cache.getKey(new HttpHost("localhost", -1, "https")));
}
 

开发者ID:MyPureCloud,
项目名称:purecloud-iot,
代码行数:10,
代码来源:TestBasicAuthCache.java

示例10: setup

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
@Before
public void setup() {
    defaultProxy = new HttpHost("default.proxy.host", 8888);
    schemePortResolver = Mockito.mock(SchemePortResolver.class);
    routePlanner = new DefaultProxyRoutePlanner(defaultProxy,
        schemePortResolver);
}
 

开发者ID:MyPureCloud,
项目名称:purecloud-iot,
代码行数:8,
代码来源:TestDefaultProxyRoutePlanner.java

示例11: setup

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Before
public void setup() throws Exception {
    conn = Mockito.mock(ManagedHttpClientConnection.class);
    socket = Mockito.mock(Socket.class);
    plainSocketFactory = Mockito.mock(ConnectionSocketFactory.class);
    sslSocketFactory = Mockito.mock(LayeredConnectionSocketFactory.class);
    socketFactoryRegistry = Mockito.mock(Lookup.class);
    schemePortResolver = Mockito.mock(SchemePortResolver.class);
    dnsResolver = Mockito.mock(DnsResolver.class);
    connectionOperator = new DefaultHttpClientConnectionOperator(
            socketFactoryRegistry, schemePortResolver, dnsResolver);
}
 

开发者ID:MyPureCloud,
项目名称:purecloud-iot,
代码行数:14,
代码来源:TestHttpClientConnectionOperator.java

示例12: initITTest

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
/**
 * Initilisation procedure for this test case.
 * 
 * @throws UnableToBuildSolRDFClientException in case the client cannot be built.
 * @throws Exception in case of Solr startup failure.
 */
@BeforeClass
public static void initITTest() {
	System.setProperty("tests.asserts", "false");	
	System.setProperty("jetty.port", "8080");
	System.setProperty("solr.core.name", "store");
	System.setProperty("solr.data.dir", initCoreDataDir.getAbsolutePath());
		
	try {
		SOLR = createJetty(
				"target/solrdf-integration-tests-1.1-dev/solrdf",
				JettyConfig.builder()
					.setPort(8080)
					.setContext("/solr")
					.stopAtShutdown(true)
					.build());		
		
		final HttpClient httpClient = HttpClientBuilder.create()
				.setRoutePlanner(
						new DefaultRoutePlanner(
								new SchemePortResolver() {
									@Override
									public int resolve(final HttpHost host) throws UnsupportedSchemeException {
										return SOLR.getLocalPort();
									}
								})).build();
		
		
		SOLRDF_CLIENT = SolRDF.newBuilder()
	              .withEndpoint("http://127.0.0.1:8080/solr/store")
	              .withGraphStoreProtocolEndpointPath("/rdf-graph-store")
	              .withHttpClient(httpClient)
	              .withSPARQLEndpointPath("/sparql")
	              .build();
		
		PLAIN_SOLR_CLIENT = new HttpSolrClient(SOLR_URI);
	} catch (final Exception exception) {
		throw new RuntimeException(exception);
	}
}
 

开发者ID:spaziocodice,
项目名称:SolRDF,
代码行数:46,
代码来源:IntegrationTestSupertypeLayer.java

示例13: setSchemePortResolver

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
/**
 * Assigns {@link SchemePortResolver} instance.
 */
public final HttpClientBuilder setSchemePortResolver(
        final SchemePortResolver schemePortResolver) {
    this.schemePortResolver = schemePortResolver;
    return this;
}
 

开发者ID:xxonehjh,
项目名称:remote-files-sync,
代码行数:9,
代码来源:HttpClientBuilder.java

示例14: SystemDefaultRoutePlanner

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
public SystemDefaultRoutePlanner(
        final SchemePortResolver schemePortResolver,
        final ProxySelector proxySelector) {
    super(schemePortResolver);
    this.proxySelector = proxySelector != null ? proxySelector : ProxySelector.getDefault();
}
 

开发者ID:xxonehjh,
项目名称:remote-files-sync,
代码行数:7,
代码来源:SystemDefaultRoutePlanner.java

示例15: DefaultRoutePlanner

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
public DefaultRoutePlanner(final SchemePortResolver schemePortResolver) {
    super();
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
}
 

开发者ID:xxonehjh,
项目名称:remote-files-sync,
代码行数:6,
代码来源:DefaultRoutePlanner.java

示例16: DefaultProxyRoutePlanner

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
public DefaultProxyRoutePlanner(final HttpHost proxy, final SchemePortResolver schemePortResolver) {
    super(schemePortResolver);
    this.proxy = Args.notNull(proxy, "Proxy host");
}
 

开发者ID:xxonehjh,
项目名称:remote-files-sync,
代码行数:5,
代码来源:DefaultProxyRoutePlanner.java

示例17: setup

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
@Before
public void setup() {
    schemePortResolver = Mockito.mock(SchemePortResolver.class);
    proxySelector = Mockito.mock(ProxySelector.class);
    routePlanner = new SystemDefaultRoutePlanner(schemePortResolver, proxySelector);
}
 

开发者ID:MyPureCloud,
项目名称:purecloud-iot,
代码行数:7,
代码来源:TestSystemDefaultRoutePlanner.java

示例18: setup

点赞 2

import org.apache.http.conn.SchemePortResolver; //导入依赖的package包/类
@Before
public void setup() {
    schemePortResolver = Mockito.mock(SchemePortResolver.class);
    routePlanner = new DefaultRoutePlanner(schemePortResolver);
}
 

开发者ID:MyPureCloud,
项目名称:purecloud-iot,
代码行数:6,
代码来源:TestDefaultRoutePlanner.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)