|
33 | 33 | import java.util.concurrent.ExecutionException; |
34 | 34 | import java.util.concurrent.TimeoutException; |
35 | 35 | import java.util.concurrent.atomic.AtomicBoolean; |
36 | | -import java.util.concurrent.atomic.AtomicLong; |
37 | 36 | import java.util.concurrent.atomic.AtomicReference; |
38 | 37 | import java.util.concurrent.locks.ReentrantLock; |
39 | 38 |
|
|
46 | 45 | import org.apache.hc.client5.http.impl.ConnPoolSupport; |
47 | 46 | import org.apache.hc.client5.http.impl.ConnectionHolder; |
48 | 47 | import org.apache.hc.client5.http.impl.ConnectionShutdownException; |
| 48 | +import org.apache.hc.client5.http.impl.PrefixedIncrementingId; |
49 | 49 | import org.apache.hc.client5.http.io.ConnectionEndpoint; |
50 | 50 | import org.apache.hc.client5.http.io.HttpClientConnectionManager; |
51 | 51 | import org.apache.hc.client5.http.io.HttpClientConnectionOperator; |
@@ -100,7 +100,7 @@ public class BasicHttpClientConnectionManager implements HttpClientConnectionMan |
100 | 100 |
|
101 | 101 | private static final Logger LOG = LoggerFactory.getLogger(BasicHttpClientConnectionManager.class); |
102 | 102 |
|
103 | | - private static final AtomicLong COUNT = new AtomicLong(0); |
| 103 | + private static final PrefixedIncrementingId INCREMENTING_ID = new PrefixedIncrementingId("ep-"); |
104 | 104 |
|
105 | 105 | private final HttpClientConnectionOperator connectionOperator; |
106 | 106 | private final HttpConnectionFactory<ManagedHttpClientConnection> connFactory; |
@@ -130,7 +130,7 @@ public BasicHttpClientConnectionManager( |
130 | 130 | super(); |
131 | 131 | this.connectionOperator = Args.notNull(httpClientConnectionOperator, "Connection operator"); |
132 | 132 | this.connFactory = connFactory != null ? connFactory : ManagedHttpClientConnectionFactory.INSTANCE; |
133 | | - this.id = String.format("ep-%010d", COUNT.getAndIncrement()); |
| 133 | + this.id = INCREMENTING_ID.getNextId(); |
134 | 134 | this.expiry = Long.MAX_VALUE; |
135 | 135 | this.socketConfig = SocketConfig.DEFAULT; |
136 | 136 | this.connectionConfig = ConnectionConfig.DEFAULT; |
|
0 commit comments