mirror of https://github.com/grpc/grpc-java.git
core: don't return concrete type from AbstractServerImplBuilder
This commit is contained in:
parent
166108a943
commit
82fce837e4
|
@ -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;
|
||||||
|
|
|
@ -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 =
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue