org.apache.http.conn.scheme.Scheme.getSocketFactory()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中org.apache.http.conn.scheme.Scheme.getSocketFactory()方法的一些代码示例,展示了Scheme.getSocketFactory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scheme.getSocketFactory()方法的具体详情如下:
包路径:org.apache.http.conn.scheme.Scheme
类名称:Scheme
方法名:getSocketFactory

Scheme.getSocketFactory介绍

[英]Obtains the socket factory. If this scheme is #isLayered, the factory implements LayeredSocketFactory.
[中]获得插座工厂。如果此方案为#IsLayed,工厂将实现LayeredSocketFactory。

代码示例

代码示例来源:origin: robovm/robovm

if (!(schm.getSocketFactory() instanceof LayeredSocketFactory)) {
  throw new IllegalArgumentException
    ("Target scheme (" + schm.getName() +
final LayeredSocketFactory lsf = (LayeredSocketFactory) schm.getSocketFactory();
final Socket sock;
try {

代码示例来源:origin: k9mail/k-9

@Test
public void checkSettings_shouldRegisterHttpsSchemeWithRegistry() throws Exception {
  configureHttpResponses(UNAUTHORIZED_401_RESPONSE, OK_200_RESPONSE);
  webDavStore.checkSettings();
  ArgumentCaptor<Scheme> schemeCaptor = ArgumentCaptor.forClass(Scheme.class);
  verify(mockSchemeRegistry).register(schemeCaptor.capture());
  assertEquals("https", schemeCaptor.getValue().getName());
  assertEquals(WebDavSocketFactory.class, schemeCaptor.getValue().getSocketFactory().getClass());
}

代码示例来源:origin: robovm/robovm

final SocketFactory sf = schm.getSocketFactory();
final SocketFactory plain_sf;
final LayeredSocketFactory layered_sf;

代码示例来源:origin: aws-amplify/aws-sdk-android

/**
 * Constructor.
 * @param config the client configuration.
 */
public ApacheHttpClient(ClientConfiguration config) {
  HttpClientFactory httpClientFactory = new HttpClientFactory();
  httpClient = httpClientFactory.createHttpClient(config);
  // disable retry
  ((AbstractHttpClient) httpClient)
      .setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(0, false));
  SchemeRegistry schemeRegistry = httpClient.getConnectionManager().getSchemeRegistry();
  Scheme https = schemeRegistry.getScheme("https");
  ((SSLSocketFactory) https.getSocketFactory())
      .setHostnameVerifier(SSLSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
}

代码示例来源:origin: MobiVM/robovm

if (!(schm.getSocketFactory() instanceof LayeredSocketFactory)) {
  throw new IllegalArgumentException
    ("Target scheme (" + schm.getName() +
final LayeredSocketFactory lsf = (LayeredSocketFactory) schm.getSocketFactory();
final Socket sock;
try {

代码示例来源:origin: FlexoVM/flexovm

if (!(schm.getSocketFactory() instanceof LayeredSocketFactory)) {
  throw new IllegalArgumentException
    ("Target scheme (" + schm.getName() +
final LayeredSocketFactory lsf = (LayeredSocketFactory) schm.getSocketFactory();
final Socket sock;
try {

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

if (!(schm.getSocketFactory() instanceof LayeredSocketFactory)) {
  throw new IllegalArgumentException
    ("Target scheme (" + schm.getName() +
final LayeredSocketFactory lsf = (LayeredSocketFactory) schm.getSocketFactory();
final Socket sock;
try {

代码示例来源:origin: com.gluonhq/robovm-rt

if (!(schm.getSocketFactory() instanceof LayeredSocketFactory)) {
  throw new IllegalArgumentException
    ("Target scheme (" + schm.getName() +
final LayeredSocketFactory lsf = (LayeredSocketFactory) schm.getSocketFactory();
final Socket sock;
try {

代码示例来源:origin: com.amazonaws/aws-android-sdk-core

/**
 * Constructor.
 * @param config the client configuration.
 */
public ApacheHttpClient(ClientConfiguration config) {
  HttpClientFactory httpClientFactory = new HttpClientFactory();
  httpClient = httpClientFactory.createHttpClient(config);
  // disable retry
  ((AbstractHttpClient) httpClient)
      .setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(0, false));
  SchemeRegistry schemeRegistry = httpClient.getConnectionManager().getSchemeRegistry();
  Scheme https = schemeRegistry.getScheme("https");
  ((SSLSocketFactory) https.getSocketFactory())
      .setHostnameVerifier(SSLSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
}

代码示例来源:origin: com.gluonhq/aws-java-sdk-core

/**
 * Constructor.
 * @param config the client configuration.
 */
public ApacheHttpClient(ClientConfiguration config) {
  HttpClientFactory httpClientFactory = new HttpClientFactory();
  httpClient = httpClientFactory.createHttpClient(config);
  // disable retry
  ((AbstractHttpClient) httpClient)
      .setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(0, false));
  SchemeRegistry schemeRegistry = httpClient.getConnectionManager().getSchemeRegistry();
  Scheme https = schemeRegistry.getScheme("https");
  ((SSLSocketFactory) https.getSocketFactory())
      .setHostnameVerifier(SSLSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
}

代码示例来源:origin: MobiVM/robovm

final SocketFactory sf = schm.getSocketFactory();
final SocketFactory plain_sf;
final LayeredSocketFactory layered_sf;

代码示例来源:origin: com.gluonhq/robovm-rt

final SocketFactory sf = schm.getSocketFactory();
final SocketFactory plain_sf;
final LayeredSocketFactory layered_sf;

代码示例来源:origin: FlexoVM/flexovm

final SocketFactory sf = schm.getSocketFactory();
final SocketFactory plain_sf;
final LayeredSocketFactory layered_sf;

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

final SocketFactory sf = schm.getSocketFactory();
final SocketFactory plain_sf;
final LayeredSocketFactory layered_sf;

相关文章