Java Code Examples for org.apache.http.impl.nio.client.HttpAsyncClients#createSystem()

The following examples show how to use org.apache.http.impl.nio.client.HttpAsyncClients#createSystem() . 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: HttpComponentsAsyncClientHttpRequestFactory.java    From spring-analysis-note with MIT License 4 votes vote down vote up
/**
 * Create a new instance of the {@code HttpComponentsAsyncClientHttpRequestFactory}
 * with a default {@link HttpAsyncClient} and {@link HttpClient}.
 */
public HttpComponentsAsyncClientHttpRequestFactory() {
	super();
	this.asyncClient = HttpAsyncClients.createSystem();
}
 
Example 2
Source File: HttpComponentsAsyncClientHttpRequestFactory.java    From java-technology-stack with MIT License 4 votes vote down vote up
/**
 * Create a new instance of the {@code HttpComponentsAsyncClientHttpRequestFactory}
 * with a default {@link HttpAsyncClient} and {@link HttpClient}.
 */
public HttpComponentsAsyncClientHttpRequestFactory() {
	super();
	this.asyncClient = HttpAsyncClients.createSystem();
}
 
Example 3
Source File: HttpComponentsAsyncClientHttpRequestFactory.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create a new instance of the {@code HttpComponentsAsyncClientHttpRequestFactory}
 * with a default {@link HttpAsyncClient} and {@link HttpClient}.
 */
public HttpComponentsAsyncClientHttpRequestFactory() {
	super();
	this.asyncClient = HttpAsyncClients.createSystem();
}
 
Example 4
Source File: PushService.java    From webpush-java with MIT License 3 votes vote down vote up
/**
 * Send a notification, but don't wait for the response.
 *
 * @param notification
 * @param encoding
 * @return
 * @throws GeneralSecurityException
 * @throws IOException
 * @throws JoseException
 */
public Future<HttpResponse> sendAsync(Notification notification, Encoding encoding) throws GeneralSecurityException, IOException, JoseException {
    HttpPost httpPost = preparePost(notification, encoding);

    final CloseableHttpAsyncClient closeableHttpAsyncClient = HttpAsyncClients.createSystem();
    closeableHttpAsyncClient.start();

    return closeableHttpAsyncClient.execute(httpPost, new ClosableCallback(closeableHttpAsyncClient));
}
 
Example 5
Source File: HttpComponentsAsyncClientHttpRequestFactory.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance of the {@code HttpComponentsAsyncClientHttpRequestFactory}
 * with a default {@link HttpAsyncClient} and {@link HttpClient}.
 */
public HttpComponentsAsyncClientHttpRequestFactory() {
	this(HttpAsyncClients.createSystem());
}