Skip to content

Commit caec155

Browse files
atehranislandelle
authored andcommitted
Implement a getter for the AsyncHttpClientConfig on AsyncHttpClient, close AsyncHttpClient#1420 (AsyncHttpClient#1422)
1 parent 8c6a633 commit caec155

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

client/src/main/java/org/asynchttpclient/AsyncHttpClient.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,4 +281,10 @@ public interface AsyncHttpClient extends Closeable {
281281
* @param predicate the predicate
282282
*/
283283
void flushChannelPoolPartitions(Predicate<Object> predicate);
284+
285+
/**
286+
* Return the config associated to this client.
287+
* @return the config associated to this client.
288+
*/
289+
AsyncHttpClientConfig getConfig();
284290
}

client/src/main/java/org/asynchttpclient/DefaultAsyncHttpClient.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,4 +276,9 @@ protected BoundRequestBuilder requestBuilder(String method, String url) {
276276
protected BoundRequestBuilder requestBuilder(Request prototype) {
277277
return new BoundRequestBuilder(this, prototype).setSignatureCalculator(signatureCalculator);
278278
}
279+
280+
@Override
281+
public AsyncHttpClientConfig getConfig() {
282+
return this.config;
283+
}
279284
}

extras/registry/src/test/java/org/asynchttpclient/extras/registry/BadAsyncHttpClient.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,9 @@ public ClientStats getClientStats() {
138138
public void flushChannelPoolPartitions(Predicate<Object> predicate) {
139139
throw new UnsupportedOperationException();
140140
}
141+
142+
@Override
143+
public AsyncHttpClientConfig getConfig() {
144+
return null;
145+
}
141146
}

extras/registry/src/test/java/org/asynchttpclient/extras/registry/TestAsyncHttpClient.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,9 @@ public ClientStats getClientStats() {
134134
public void flushChannelPoolPartitions(Predicate<Object> predicate) {
135135
throw new UnsupportedOperationException();
136136
}
137+
138+
@Override
139+
public AsyncHttpClientConfig getConfig() {
140+
return null;
141+
}
137142
}

0 commit comments

Comments
 (0)