core: don't return concrete type from AbstractServerImplBuilder

This commit is contained in:
Carl Mastrangelo 2017-06-01 14:38:05 -07:00 committed by GitHub
parent 166108a943
commit 82fce837e4
3 changed files with 6 additions and 5 deletions

View File

@ -17,13 +17,13 @@
package io.grpc.benchmarks.driver; package io.grpc.benchmarks.driver;
import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.google.common.util.concurrent.ThreadFactoryBuilder;
import io.grpc.Server;
import io.grpc.Status; import io.grpc.Status;
import io.grpc.benchmarks.proto.Control; import io.grpc.benchmarks.proto.Control;
import io.grpc.benchmarks.proto.Control.ClientArgs; import io.grpc.benchmarks.proto.Control.ClientArgs;
import io.grpc.benchmarks.proto.Control.ServerArgs; import io.grpc.benchmarks.proto.Control.ServerArgs;
import io.grpc.benchmarks.proto.Control.ServerArgs.ArgtypeCase; import io.grpc.benchmarks.proto.Control.ServerArgs.ArgtypeCase;
import io.grpc.benchmarks.proto.WorkerServiceGrpc; import io.grpc.benchmarks.proto.WorkerServiceGrpc;
import io.grpc.internal.ServerImpl;
import io.grpc.netty.NettyServerBuilder; import io.grpc.netty.NettyServerBuilder;
import io.grpc.stub.StreamObserver; import io.grpc.stub.StreamObserver;
import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup;
@ -39,7 +39,7 @@ public class LoadWorker {
private static final Logger log = Logger.getLogger(LoadWorker.class.getName()); private static final Logger log = Logger.getLogger(LoadWorker.class.getName());
private final int serverPort; private final int serverPort;
private final ServerImpl driverServer; private final Server driverServer;
LoadWorker(int driverPort, int serverPort) throws Exception { LoadWorker(int driverPort, int serverPort) throws Exception {
this.serverPort = serverPort; this.serverPort = serverPort;

View File

@ -31,6 +31,7 @@ import io.grpc.DecompressorRegistry;
import io.grpc.HandlerRegistry; import io.grpc.HandlerRegistry;
import io.grpc.Internal; import io.grpc.Internal;
import io.grpc.InternalNotifyOnServerBuild; import io.grpc.InternalNotifyOnServerBuild;
import io.grpc.Server;
import io.grpc.ServerBuilder; import io.grpc.ServerBuilder;
import io.grpc.ServerMethodDefinition; import io.grpc.ServerMethodDefinition;
import io.grpc.ServerServiceDefinition; import io.grpc.ServerServiceDefinition;
@ -155,7 +156,7 @@ public abstract class AbstractServerImplBuilder<T extends AbstractServerImplBuil
} }
@Override @Override
public ServerImpl build() { public Server build() {
ArrayList<ServerStreamTracer.Factory> tracerFactories = ArrayList<ServerStreamTracer.Factory> tracerFactories =
new ArrayList<ServerStreamTracer.Factory>(); new ArrayList<ServerStreamTracer.Factory>();
StatsContextFactory statsFactory = StatsContextFactory statsFactory =

View File

@ -29,6 +29,7 @@ import io.grpc.Context.CancellableContext;
import io.grpc.Deadline; import io.grpc.Deadline;
import io.grpc.ManagedChannel; import io.grpc.ManagedChannel;
import io.grpc.Metadata; import io.grpc.Metadata;
import io.grpc.Server;
import io.grpc.ServerCall; import io.grpc.ServerCall;
import io.grpc.ServerCallHandler; import io.grpc.ServerCallHandler;
import io.grpc.ServerInterceptor; import io.grpc.ServerInterceptor;
@ -37,7 +38,6 @@ import io.grpc.Status;
import io.grpc.StatusRuntimeException; import io.grpc.StatusRuntimeException;
import io.grpc.inprocess.InProcessChannelBuilder; import io.grpc.inprocess.InProcessChannelBuilder;
import io.grpc.inprocess.InProcessServerBuilder; import io.grpc.inprocess.InProcessServerBuilder;
import io.grpc.internal.ServerImpl;
import io.grpc.stub.ServerCallStreamObserver; import io.grpc.stub.ServerCallStreamObserver;
import io.grpc.stub.StreamObserver; import io.grpc.stub.StreamObserver;
import io.grpc.testing.integration.Messages.SimpleRequest; import io.grpc.testing.integration.Messages.SimpleRequest;
@ -67,7 +67,7 @@ public class CascadingTest {
@Mock @Mock
TestServiceGrpc.TestServiceImplBase service; TestServiceGrpc.TestServiceImplBase service;
private ManagedChannel channel; private ManagedChannel channel;
private ServerImpl server; private Server server;
private CountDownLatch observedCancellations; private CountDownLatch observedCancellations;
private CountDownLatch receivedCancellations; private CountDownLatch receivedCancellations;
private TestServiceGrpc.TestServiceBlockingStub blockingStub; private TestServiceGrpc.TestServiceBlockingStub blockingStub;