|
29 | 29 |
|
30 | 30 | public class NatsServerPool implements ServerPool { |
31 | 31 |
|
32 | | - private final ReentrantLock listLock; |
33 | | - private List<ServerPoolEntry> entryList; |
34 | | - private Options options; |
35 | | - private int maxConnectAttempts; |
36 | | - private NatsUri lastConnected; |
37 | | - private boolean hasSecureServer; |
38 | | - private String defaultScheme; |
| 32 | + protected final ReentrantLock listLock; |
| 33 | + protected List<ServerPoolEntry> entryList; |
| 34 | + protected Options options; |
| 35 | + protected int maxConnectAttempts; |
| 36 | + protected NatsUri lastConnected; |
| 37 | + protected boolean hasSecureServer; |
| 38 | + protected String defaultScheme; |
39 | 39 |
|
40 | 40 | public NatsServerPool() { |
41 | 41 | listLock = new ReentrantLock(); |
@@ -148,7 +148,7 @@ public boolean acceptDiscoveredUrls(List<String> discoveredServers) { |
148 | 148 | } |
149 | 149 | } |
150 | 150 |
|
151 | | - private void afterListChanged() { |
| 151 | + protected void afterListChanged() { |
152 | 152 | // 1. randomize if needed and allowed |
153 | 153 | if (entryList.size() > 1 && !options.isNoRandomize()) { |
154 | 154 | Collections.shuffle(entryList, ThreadLocalRandom.current()); |
@@ -298,7 +298,7 @@ public boolean hasSecureServer() { |
298 | 298 | return hasSecureServer; |
299 | 299 | } |
300 | 300 |
|
301 | | - private int findEquivalent(List<NatsUri> list, NatsUri toFind) { |
| 301 | + protected int findEquivalent(List<NatsUri> list, NatsUri toFind) { |
302 | 302 | for (int i = 0; i < list.size(); i++) { |
303 | 303 | NatsUri nuri = list.get(i); |
304 | 304 | if (nuri.equivalent(toFind)) { |
|
0 commit comments