Java Code Examples for org.eclipse.jetty.client.HttpClient#setByteBufferPool()

The following examples show how to use org.eclipse.jetty.client.HttpClient#setByteBufferPool() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JettyClientHttpConnector.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Constructor with an {@link JettyResourceFactory} that will manage shared resources.
 * @param resourceFactory the {@link JettyResourceFactory} to use
 * @param customizer the lambda used to customize the {@link HttpClient}
 */
public JettyClientHttpConnector(
		JettyResourceFactory resourceFactory, @Nullable Consumer<HttpClient> customizer) {

	HttpClient httpClient = new HttpClient();
	httpClient.setExecutor(resourceFactory.getExecutor());
	httpClient.setByteBufferPool(resourceFactory.getByteBufferPool());
	httpClient.setScheduler(resourceFactory.getScheduler());
	if (customizer != null) {
		customizer.accept(httpClient);
	}
	this.httpClient = httpClient;
}
 
Example 2
Source File: JettyClientHttpConnector.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Constructor with an {@link JettyResourceFactory} that will manage shared resources.
 * @param resourceFactory the {@link JettyResourceFactory} to use
 * @param customizer the lambda used to customize the {@link HttpClient}
 */
public JettyClientHttpConnector(
		JettyResourceFactory resourceFactory, @Nullable Consumer<HttpClient> customizer) {

	HttpClient httpClient = new HttpClient();
	httpClient.setExecutor(resourceFactory.getExecutor());
	httpClient.setByteBufferPool(resourceFactory.getByteBufferPool());
	httpClient.setScheduler(resourceFactory.getScheduler());
	if (customizer != null) {
		customizer.accept(httpClient);
	}
	this.httpClient = httpClient;
}