com.ning.http.client.AsyncHttpClientConfig.getAsyncHttpProviderConfig()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(76)

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

AsyncHttpClientConfig.getAsyncHttpProviderConfig介绍

[英]Return the com.ning.http.client.AsyncHttpProviderConfig
[中]返回com。宁。http。客户AsyncHttpProviderConfig

代码示例

代码示例来源:origin: com.ning/async-http-client

public JDKAsyncHttpProvider(AsyncHttpClientConfig config) {
  this.config = config;
  AsyncHttpProviderConfig<?, ?> providerConfig = config.getAsyncHttpProviderConfig();
  if (providerConfig instanceof JDKAsyncHttpProviderConfig) {
    configure(JDKAsyncHttpProviderConfig.class.cast(providerConfig));
  }
}

代码示例来源:origin: com.ning/async-http-client

private static GrizzlyWebSocketAdapter createWebSocketAdapter(
    final HttpTransactionContext context) {
  
  return GrizzlyWebSocketAdapter.newInstance(
      context.provider.getClientConfig().getAsyncHttpProviderConfig(),
      context.protocolHandler);
}

代码示例来源:origin: com.ning/async-http-client

public GrizzlyAsyncHttpProvider(final AsyncHttpClientConfig clientConfig) {
  this.clientConfig = clientConfig;
  this.providerConfig =
      clientConfig.getAsyncHttpProviderConfig() instanceof GrizzlyAsyncHttpProviderConfig ?
      (GrizzlyAsyncHttpProviderConfig) clientConfig.getAsyncHttpProviderConfig()
      : new GrizzlyAsyncHttpProviderConfig();
  final TCPNIOTransportBuilder builder = TCPNIOTransportBuilder.newInstance();
  clientTransport = builder.build();
  initializeTransport(clientConfig);
  connectionManager = new ConnectionManager(this, clientTransport, providerConfig);
  try {
    clientTransport.start();
  } catch (IOException ioe) {
    throw new RuntimeException(ioe);
  }
}

代码示例来源:origin: com.ning/async-http-client

public NettyAsyncHttpProvider(AsyncHttpClientConfig config) {
  this.config = config;
  nettyConfig = config.getAsyncHttpProviderConfig() instanceof NettyAsyncHttpProviderConfig ? //
  (NettyAsyncHttpProviderConfig) config.getAsyncHttpProviderConfig()
      : new NettyAsyncHttpProviderConfig();
  allowStopNettyTimer = nettyConfig.getNettyTimer() == null;
  nettyTimer = allowStopNettyTimer ? newNettyTimer() : nettyConfig.getNettyTimer();
  channelManager = new ChannelManager(config, nettyConfig, nettyTimer);
  requestSender = new NettyRequestSender(config, nettyConfig, channelManager, nettyTimer, closed);
  channelManager.configureBootstraps(requestSender, closed);
}

代码示例来源:origin: com.ning/async-http-client

providerConfig = prototype.getAsyncHttpProviderConfig();
connectTimeout = prototype.getConnectTimeout();
pooledConnectionIdleTimeout = prototype.getPooledConnectionIdleTimeout();

代码示例来源:origin: io.gatling/async-http-client

public JDKAsyncHttpProvider(AsyncHttpClientConfig config) {
  this.config = config;
  AsyncHttpProviderConfig<?, ?> providerConfig = config.getAsyncHttpProviderConfig();
  if (providerConfig instanceof JDKAsyncHttpProviderConfig) {
    configure(JDKAsyncHttpProviderConfig.class.cast(providerConfig));
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-client

private static GrizzlyWebSocketAdapter createWebSocketAdapter(
    final HttpTransactionContext context) {
  
  return GrizzlyWebSocketAdapter.newInstance(
      context.provider.getClientConfig().getAsyncHttpProviderConfig(),
      context.protocolHandler);
}

代码示例来源:origin: javaee/grizzly-ahc

private static GrizzlyWebSocketAdapter createWebSocketAdapter(
    final HttpTransactionContext context) {
  
  return GrizzlyWebSocketAdapter.newInstance(
      context.provider.getClientConfig().getAsyncHttpProviderConfig(),
      context.protocolHandler);
}

代码示例来源:origin: io.gatling/async-http-client

private static GrizzlyWebSocketAdapter createWebSocketAdapter(final HttpTransactionContext context) {
  SimpleWebSocket ws = new SimpleWebSocket(context.protocolHandler);
  AsyncHttpProviderConfig config = context.provider.clientConfig.getAsyncHttpProviderConfig();
  boolean bufferFragments = true;
  if (config instanceof GrizzlyAsyncHttpProviderConfig) {
    bufferFragments = (Boolean) ((GrizzlyAsyncHttpProviderConfig) config).getProperty(BUFFER_WEBSOCKET_FRAGMENTS);
  }
  return new GrizzlyWebSocketAdapter(ws, bufferFragments);
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-client

public GrizzlyAsyncHttpProvider(final AsyncHttpClientConfig clientConfig) {
  this.clientConfig = clientConfig;
  this.providerConfig =
      clientConfig.getAsyncHttpProviderConfig() instanceof GrizzlyAsyncHttpProviderConfig ?
      (GrizzlyAsyncHttpProviderConfig) clientConfig.getAsyncHttpProviderConfig()
      : new GrizzlyAsyncHttpProviderConfig();
  final TCPNIOTransportBuilder builder = TCPNIOTransportBuilder.newInstance();
  clientTransport = builder.build();
  initializeTransport(clientConfig);
  connectionManager = new ConnectionManager(this, clientTransport, providerConfig);
  try {
    clientTransport.start();
  } catch (IOException ioe) {
    throw new RuntimeException(ioe);
  }
}

代码示例来源:origin: io.gatling/async-http-client

public GrizzlyAsyncHttpProvider(final AsyncHttpClientConfig clientConfig) {
  this.clientConfig = clientConfig;
  this.providerConfig =
      clientConfig.getAsyncHttpProviderConfig() instanceof GrizzlyAsyncHttpProviderConfig ?
      (GrizzlyAsyncHttpProviderConfig) clientConfig.getAsyncHttpProviderConfig()
      : new GrizzlyAsyncHttpProviderConfig();
  final TCPNIOTransportBuilder builder = TCPNIOTransportBuilder.newInstance();
  clientTransport = builder.build();
  initializeTransport(clientConfig);
  connectionManager = new ConnectionManager(this, clientTransport, providerConfig);
  try {
    clientTransport.start();
  } catch (IOException ioe) {
    throw new RuntimeException(ioe);
  }
}

代码示例来源:origin: io.gatling/async-http-client

public NettyAsyncHttpProvider(AsyncHttpClientConfig config) {
  this.config = config;
  nettyConfig = config.getAsyncHttpProviderConfig() instanceof NettyAsyncHttpProviderConfig ? //
  (NettyAsyncHttpProviderConfig) config.getAsyncHttpProviderConfig()
      : new NettyAsyncHttpProviderConfig();
  allowStopNettyTimer = nettyConfig.getNettyTimer() == null;
  nettyTimer = allowStopNettyTimer ? newNettyTimer() : nettyConfig.getNettyTimer();
  channelManager = new ChannelManager(config, nettyConfig, nettyTimer);
  requestSender = new NettyRequestSender(config, nettyConfig, channelManager, nettyTimer, closed);
  channelManager.configureBootstraps(requestSender, closed);
}

代码示例来源:origin: javaee/grizzly-ahc

public GrizzlyAsyncHttpProvider(final AsyncHttpClientConfig clientConfig) {
  this.clientConfig = clientConfig;
  this.providerConfig =
      clientConfig.getAsyncHttpProviderConfig() instanceof GrizzlyAsyncHttpProviderConfig ?
      (GrizzlyAsyncHttpProviderConfig) clientConfig.getAsyncHttpProviderConfig()
      : new GrizzlyAsyncHttpProviderConfig();
  final TCPNIOTransportBuilder builder = TCPNIOTransportBuilder.newInstance();
  clientTransport = builder.build();
  initializeTransport(clientConfig);
  connectionManager = new ConnectionManager(this, clientTransport, providerConfig);
  try {
    clientTransport.start();
  } catch (IOException ioe) {
    throw new RuntimeException(ioe);
  }
}

代码示例来源:origin: io.gatling/async-http-client

public ApacheAsyncHttpProvider(AsyncHttpClientConfig config) {
  this.config = config;
  connectionManager = new MultiThreadedHttpConnectionManager();
  params = new HttpClientParams();
  params.setParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, Boolean.TRUE);
  params.setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
  params.setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler());
  reaper = getReaper(config.getAsyncHttpProviderConfig());
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-client

providerConfig = prototype.getAsyncHttpProviderConfig();
connectTimeout = prototype.getConnectTimeout();
pooledConnectionIdleTimeout = prototype.getPooledConnectionIdleTimeout();

代码示例来源:origin: io.gatling/async-http-client

providerConfig = prototype.getAsyncHttpProviderConfig();
connectionTimeout = prototype.getConnectionTimeout();
pooledConnectionIdleTimeout = prototype.getPooledConnectionIdleTimeout();

代码示例来源:origin: javaee/grizzly-ahc

providerConfig = prototype.getAsyncHttpProviderConfig();
connectTimeout = prototype.getConnectTimeout();
pooledConnectionIdleTimeout = prototype.getPooledConnectionIdleTimeout();

相关文章

微信公众号

最新文章

更多