diff --git a/core/src/main/java/io/grpc/Channel.java b/core/src/main/java/io/grpc/Channel.java index dcfc7812a4..af0e5ae793 100644 --- a/core/src/main/java/io/grpc/Channel.java +++ b/core/src/main/java/io/grpc/Channel.java @@ -41,11 +41,11 @@ import javax.annotation.concurrent.ThreadSafe; * *

Applications can add common cross-cutting behaviors to stubs by decorating Channel * implementations using {@link ClientInterceptor}. It is expected that most application - * code will not use this interface directly but rather work with stubs that have been bound to a + * code will not use this class directly but rather work with stubs that have been bound to a * Channel that was decorated during application initialization, */ @ThreadSafe -public interface Channel { +public abstract class Channel { /** * Create a {@link Call} to the remote operation specified by the given @@ -57,6 +57,6 @@ public interface Channel { * @return a {@link Call} bound to the specified method. * */ - public Call newCall( + public abstract Call newCall( MethodDescriptor methodDescriptor); } diff --git a/core/src/main/java/io/grpc/ChannelImpl.java b/core/src/main/java/io/grpc/ChannelImpl.java index 7532cd1a9f..8f05e7406f 100644 --- a/core/src/main/java/io/grpc/ChannelImpl.java +++ b/core/src/main/java/io/grpc/ChannelImpl.java @@ -52,7 +52,7 @@ import javax.annotation.concurrent.ThreadSafe; /** A communication channel for making outgoing RPCs. */ @ThreadSafe -public final class ChannelImpl implements Channel { +public final class ChannelImpl extends Channel { private static final Logger log = Logger.getLogger(ChannelImpl.class.getName()); diff --git a/core/src/main/java/io/grpc/ClientInterceptors.java b/core/src/main/java/io/grpc/ClientInterceptors.java index c8c1ae4d39..4c4fc342ab 100644 --- a/core/src/main/java/io/grpc/ClientInterceptors.java +++ b/core/src/main/java/io/grpc/ClientInterceptors.java @@ -77,7 +77,7 @@ public class ClientInterceptors { return new InterceptorChannel(channel, interceptors); } - private static class InterceptorChannel implements Channel { + private static class InterceptorChannel extends Channel { private final Channel channel; private final Iterable interceptors; @@ -92,7 +92,7 @@ public class ClientInterceptors { } } - private static class ProcessInterceptorChannel implements Channel { + private static class ProcessInterceptorChannel extends Channel { private final Channel channel; private Iterator interceptors; diff --git a/core/src/main/java/io/grpc/Server.java b/core/src/main/java/io/grpc/Server.java index 34f70b0bdd..92e35bef05 100644 --- a/core/src/main/java/io/grpc/Server.java +++ b/core/src/main/java/io/grpc/Server.java @@ -34,8 +34,8 @@ package io.grpc; import javax.annotation.concurrent.ThreadSafe; /** - * Server for listening for and dispatching incoming calls. Although Server is an interface, it is - * not expected to be implemented by application code or interceptors. + * Server for listening for and dispatching incoming calls. It is not expected to be implemented by + * application code or interceptors. */ @ThreadSafe -public interface Server {} +public abstract class Server {} diff --git a/core/src/main/java/io/grpc/ServerImpl.java b/core/src/main/java/io/grpc/ServerImpl.java index 2ef2cbd739..807e6aa02d 100644 --- a/core/src/main/java/io/grpc/ServerImpl.java +++ b/core/src/main/java/io/grpc/ServerImpl.java @@ -61,7 +61,7 @@ import java.util.concurrent.TimeUnit; *

Starting the server starts the underlying transport for servicing requests. Stopping the * server stops servicing new requests and waits for all connections to terminate. */ -public class ServerImpl implements Server { +public final class ServerImpl extends Server { private static final ServerStreamListener NOOP_LISTENER = new NoopListener(); /** Executor for application processing. */ diff --git a/integration-testing/src/test/java/io/grpc/stub/StubConfigTest.java b/integration-testing/src/test/java/io/grpc/stub/StubConfigTest.java index 7c305469c7..e1d769cafb 100644 --- a/integration-testing/src/test/java/io/grpc/stub/StubConfigTest.java +++ b/integration-testing/src/test/java/io/grpc/stub/StubConfigTest.java @@ -70,7 +70,7 @@ public class StubConfigTest { } - private static class FakeChannel implements Channel { + private static class FakeChannel extends Channel { @Override public Call newCall(MethodDescriptor method) { return null;