This repository has been archived by the owner on Jun 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 727
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set all config objects on the async client in client factory- fixes #219
- Loading branch information
kramer
committed
Jul 1, 2015
1 parent
5470a41
commit 563b658
Showing
5 changed files
with
165 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
jest/src/main/java/io/searchbox/client/config/idle/HttpReapableConnectionManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
package io.searchbox.client.config.idle; | ||
|
||
import org.apache.http.conn.HttpClientConnectionManager; | ||
import org.apache.http.nio.conn.NHttpClientConnectionManager; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
public class HttpReapableConnectionManager implements ReapableConnectionManager { | ||
private final HttpClientConnectionManager connectionManager; | ||
private final NHttpClientConnectionManager nConnectionManager; | ||
|
||
public HttpReapableConnectionManager(HttpClientConnectionManager connectionManager, NHttpClientConnectionManager nConnectionManager) { | ||
if(connectionManager == null || nConnectionManager == null) throw new IllegalArgumentException(); | ||
|
||
public HttpReapableConnectionManager(HttpClientConnectionManager connectionManager) { | ||
this.connectionManager = connectionManager; | ||
this.nConnectionManager = nConnectionManager; | ||
} | ||
|
||
@Override | ||
public void closeIdleConnections(long idleTimeout, TimeUnit unit) { | ||
connectionManager.closeIdleConnections(idleTimeout, unit); | ||
nConnectionManager.closeIdleConnections(idleTimeout, unit); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters