public JDKAsyncHttpProvider(AsyncHttpClientConfig config) { this.config = config; AsyncHttpProviderConfig<?, ?> providerConfig = config.getAsyncHttpProviderConfig(); if (providerConfig instanceof JDKAsyncHttpProviderConfig) { configure(JDKAsyncHttpProviderConfig.class.cast(providerConfig)); } }
private static GrizzlyWebSocketAdapter createWebSocketAdapter( final HttpTransactionContext context) { return GrizzlyWebSocketAdapter.newInstance( context.provider.getClientConfig().getAsyncHttpProviderConfig(), context.protocolHandler); }
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); } }
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); }
providerConfig = prototype.getAsyncHttpProviderConfig(); connectTimeout = prototype.getConnectTimeout(); pooledConnectionIdleTimeout = prototype.getPooledConnectionIdleTimeout();
public JDKAsyncHttpProvider(AsyncHttpClientConfig config) { this.config = config; AsyncHttpProviderConfig<?, ?> providerConfig = config.getAsyncHttpProviderConfig(); if (providerConfig instanceof JDKAsyncHttpProviderConfig) { configure(JDKAsyncHttpProviderConfig.class.cast(providerConfig)); } }
private static GrizzlyWebSocketAdapter createWebSocketAdapter( final HttpTransactionContext context) { return GrizzlyWebSocketAdapter.newInstance( context.provider.getClientConfig().getAsyncHttpProviderConfig(), context.protocolHandler); }
private static GrizzlyWebSocketAdapter createWebSocketAdapter( final HttpTransactionContext context) { return GrizzlyWebSocketAdapter.newInstance( context.provider.getClientConfig().getAsyncHttpProviderConfig(), context.protocolHandler); }
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); }
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); } }
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); } }
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); }
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); } }
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()); }
providerConfig = prototype.getAsyncHttpProviderConfig(); connectTimeout = prototype.getConnectTimeout(); pooledConnectionIdleTimeout = prototype.getPooledConnectionIdleTimeout();
providerConfig = prototype.getAsyncHttpProviderConfig(); connectionTimeout = prototype.getConnectionTimeout(); pooledConnectionIdleTimeout = prototype.getPooledConnectionIdleTimeout();
providerConfig = prototype.getAsyncHttpProviderConfig(); connectTimeout = prototype.getConnectTimeout(); pooledConnectionIdleTimeout = prototype.getPooledConnectionIdleTimeout();