|
37 | 37 | import io.grpc.CallCredentials; |
38 | 38 | import io.grpc.CallOptions; |
39 | 39 | import io.grpc.Channel; |
| 40 | +import io.grpc.ChannelConfigurer; |
40 | 41 | import io.grpc.ChannelCredentials; |
41 | 42 | import io.grpc.ChannelLogger; |
42 | 43 | import io.grpc.ChannelLogger.ChannelLogLevel; |
43 | | -import io.grpc.ChildChannelConfigurer; |
44 | 44 | import io.grpc.ClientCall; |
45 | 45 | import io.grpc.ClientInterceptor; |
46 | 46 | import io.grpc.ClientInterceptors; |
@@ -156,7 +156,13 @@ public Result selectConfig(PickSubchannelArgs args) { |
156 | 156 | private static final LoadBalancer.PickDetailsConsumer NOOP_PICK_DETAILS_CONSUMER = |
157 | 157 | new LoadBalancer.PickDetailsConsumer() {}; |
158 | 158 |
|
159 | | - private ChildChannelConfigurer childChannelConfigurer = new ChildChannelConfigurer() {}; |
| 159 | + /** |
| 160 | + * Retrieves the user-provided configuration function for internal child channels. |
| 161 | + * |
| 162 | + * <p>This is intended for use by gRPC internal components |
| 163 | + * that are responsible for creating auxiliary {@code ManagedChannel} instances. |
| 164 | + */ |
| 165 | + private ChannelConfigurer channelConfigurer = new ChannelConfigurer() {}; |
160 | 166 |
|
161 | 167 | private final InternalLogId logId; |
162 | 168 | private final String target; |
@@ -548,8 +554,8 @@ ClientStream newSubstream( |
548 | 554 | Supplier<Stopwatch> stopwatchSupplier, |
549 | 555 | List<ClientInterceptor> interceptors, |
550 | 556 | final TimeProvider timeProvider) { |
551 | | - if (builder.childChannelConfigurer != null) { |
552 | | - this.childChannelConfigurer = builder.childChannelConfigurer; |
| 557 | + if (builder.channelConfigurer != null) { |
| 558 | + this.channelConfigurer = builder.channelConfigurer; |
553 | 559 | } |
554 | 560 | this.target = checkNotNull(builder.target, "target"); |
555 | 561 | this.logId = InternalLogId.allocate("Channel", target); |
@@ -596,7 +602,7 @@ ClientStream newSubstream( |
596 | 602 | .setOverrideAuthority(this.authorityOverride) |
597 | 603 | .setMetricRecorder(this.metricRecorder) |
598 | 604 | .setNameResolverRegistry(builder.nameResolverRegistry) |
599 | | - .setChildChannelConfigurer(this.childChannelConfigurer); |
| 605 | + .setChildChannelConfigurer(this.channelConfigurer); |
600 | 606 | builder.copyAllNameResolverCustomArgsTo(nameResolverArgsBuilder); |
601 | 607 | this.nameResolverArgs = nameResolverArgsBuilder.build(); |
602 | 608 | this.nameResolver = getNameResolver( |
@@ -672,15 +678,6 @@ public CallTracer create() { |
672 | 678 | } |
673 | 679 | } |
674 | 680 |
|
675 | | - /** |
676 | | - * Retrieves the user-provided configuration function for internal child channels. |
677 | | - * |
678 | | - * <p>This method is intended for use by gRPC internal components |
679 | | - * that are responsible for creating auxiliary {@code ManagedChannel} instances. |
680 | | - * |
681 | | - * @return the ChildChannelConfigurer, guaranteed to be not null (defaults to no-op). |
682 | | - */ |
683 | | - |
684 | 681 | @VisibleForTesting |
685 | 682 | static NameResolver getNameResolver( |
686 | 683 | UriWrapper targetUri, @Nullable final String overrideAuthority, |
@@ -1504,8 +1501,8 @@ protected ManagedChannelBuilder<?> delegate() { |
1504 | 1501 |
|
1505 | 1502 | // Note that we follow the global configurator pattern and try to fuse the configurations as |
1506 | 1503 | // soon as the builder gets created |
1507 | | - if (childChannelConfigurer != null) { |
1508 | | - childChannelConfigurer.configureChannelBuilder(builder); |
| 1504 | + if (channelConfigurer != null) { |
| 1505 | + channelConfigurer.configureChannelBuilder(builder); |
1509 | 1506 | } |
1510 | 1507 |
|
1511 | 1508 | return builder |
|
0 commit comments