api: Expose ForwardingServerBuilder for XdsServerBuilder - #7633
Conversation
| import javax.annotation.Nullable; | ||
|
|
||
| /** | ||
| * A {@link ServerBuilder} that delegates all its builder method to another builder by default. |
There was a problem hiding this comment.
s/all its builder method/all its builder methods/
| /** | ||
| * This method serves to force sub classes to "hide" this static factory. | ||
| */ | ||
| public static ServerBuilder<?> forPort(int port) { |
There was a problem hiding this comment.
The XdsServerBuilder subclass will only define this as VisibleForTesting to be used by test code. Actual user code is supposed to call forPort(int,ServerCredentials) . However the subclass cannot reduce the visibility from public to package-private. Not that we can do anything in this PR about it...
|
Hm, why copy ForwardingServerBuilder and not just make it public? I believe the only reason we made it package-private is because it wasn't used anymore after we reverted NettyServerBuilder to extend AbstractServerImplBuilder. |
sergiitk
left a comment
There was a problem hiding this comment.
I think this is a good reason to make ForwardingServerBuilder public.
This reduces ABI issues caused by returning the more precise XdsServerBuilder in the API. See grpc#7552.
442f0c9 to
3ee1b17
Compare
|
I didn't make it public since I didn't want to do that in the 11th hour. But I agree it should be mostly fine. Done. |
This reduces ABI issues caused by returning the more precise
XdsServerBuilder in the API. See
#7552.