Skip to content

servlet: introduce ServletServerBuilder.buildServlet() #10921

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

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions servlet/src/main/java/io/grpc/servlet/GrpcServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package io.grpc.servlet;

import com.google.common.annotations.VisibleForTesting;
import io.grpc.BindableService;
import io.grpc.ExperimentalApi;
import java.io.IOException;
Expand All @@ -40,7 +39,6 @@ public class GrpcServlet extends HttpServlet {

private final ServletAdapter servletAdapter;

@VisibleForTesting
GrpcServlet(ServletAdapter servletAdapter) {
this.servletAdapter = servletAdapter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ public ServletAdapter buildServletAdapter() {
return new ServletAdapter(buildAndStart(), streamTracerFactories, maxInboundMessageSize);
}

/**
* Creates a {@link GrpcServlet}.
*/
public GrpcServlet buildServlet() {
return new GrpcServlet(buildServletAdapter());
}

private ServerTransportListener buildAndStart() {
Server server;
try {
Expand Down