-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compiler: Generate interfaces for services to implement #9688
Conversation
Rename TestService to TestServiceAsync Change TestServiceAsync default implementations to be copies of TestServiceImplBase's Change exception type thrown by default implementations of Blocking and Future interaces to UnsupportedOperationException
…nd done for TestServiceGrpc.java.
We do not want the client stubs to implement the interfaces; they are final today to prevent mocking. |
alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java
Outdated
Show resolved
Hide resolved
alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java
Outdated
Show resolved
Hide resolved
* Add a bindService(<service>Async) method * Remove methods from BaseImpl that were defaulted in Interface * Fix indentations.
@ejona86 Ready for rereview. |
…instead of using ImplBase.
@ejona86 ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still going through it. Sending what I have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. We need to check if the ExperimentalApi annotations will compile cleanly with grpc-java-api-checker.
alts/src/test/java/io/grpc/alts/HandshakerServiceChannelTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generated code looks good.
alts/src/test/java/io/grpc/alts/HandshakerServiceChannelTest.java
Outdated
Show resolved
Hide resolved
… alts and revert the ignore of venv.
When generating Java code from an rpc proto, not only generate the ImplBase and stub methods, but also generate an interface named AsyncService containing the async service methods and have the <service>ImplBase classes implement it in addition to BindableService.
All methods for the interfaces are defined with defaults.
The current logic for the methods in <service>ImplBase will be moved to the default methods ofAsyncService and the methods will be removed from <service>ImplBase.
The bindService logic will be moved into the main Grpc class in a method with the signature:
public static final io.grpc.ServerServiceDefinition bindService(<service>Async serviceImpl)
fixes #9320