diff --git a/core/src/main/java/io/grpc/ClientCall.java b/core/src/main/java/io/grpc/ClientCall.java index 6e69d0696b..34358924aa 100644 --- a/core/src/main/java/io/grpc/ClientCall.java +++ b/core/src/main/java/io/grpc/ClientCall.java @@ -61,10 +61,10 @@ package io.grpc; * {@link Status#CANCELLED CANCELLED}. Otherwise, {@link Listener#onClose Listener.onClose()} is * called with whatever status the RPC was finished. We ensure that at most one is called. * - * @param type of message sent one or more times to the server. - * @param type of message received one or more times from the server. + * @param type of message sent one or more times to the server. + * @param type of message received one or more times from the server. */ -public abstract class ClientCall { +public abstract class ClientCall { /** * Callbacks for receiving metadata, response messages and completion status from the server. * @@ -123,7 +123,7 @@ public abstract class ClientCall { * @throws IllegalStateException if a method (including {@code start()}) on this class has been * called. */ - public abstract void start(Listener responseListener, Metadata headers); + public abstract void start(Listener responseListener, Metadata headers); /** * Requests up to the given number of messages from the call to be delivered to @@ -170,7 +170,7 @@ public abstract class ClientCall { * @param message message to be sent to the server. * @throws IllegalStateException if call is {@link #halfClose}d or explicitly {@link #cancel}ed */ - public abstract void sendMessage(RequestT message); + public abstract void sendMessage(ReqT message); /** * If {@code true}, indicates that the call is capable of sending additional messages diff --git a/core/src/main/java/io/grpc/ClientInterceptor.java b/core/src/main/java/io/grpc/ClientInterceptor.java index 2073de9e07..f8350d776a 100644 --- a/core/src/main/java/io/grpc/ClientInterceptor.java +++ b/core/src/main/java/io/grpc/ClientInterceptor.java @@ -58,8 +58,6 @@ public interface ClientInterceptor { * @param next the channel which is being intercepted. * @return the call object for the remote operation, never {@code null}. */ - ClientCall interceptCall( - MethodDescriptor method, - CallOptions callOptions, - Channel next); + ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next); } diff --git a/core/src/main/java/io/grpc/MethodDescriptor.java b/core/src/main/java/io/grpc/MethodDescriptor.java index 71b9093174..197bad99b7 100644 --- a/core/src/main/java/io/grpc/MethodDescriptor.java +++ b/core/src/main/java/io/grpc/MethodDescriptor.java @@ -47,12 +47,12 @@ import javax.annotation.concurrent.Immutable; *

Can be constructed manually but will often be generated by stub code generators. */ @Immutable -public class MethodDescriptor { +public class MethodDescriptor { private final MethodType type; private final String fullMethodName; - private final Marshaller requestMarshaller; - private final Marshaller responseMarshaller; + private final Marshaller requestMarshaller; + private final Marshaller responseMarshaller; /** * The call type of a method. @@ -150,8 +150,8 @@ public class MethodDescriptor { } private MethodDescriptor(MethodType type, String fullMethodName, - Marshaller requestMarshaller, - Marshaller responseMarshaller) { + Marshaller requestMarshaller, + Marshaller responseMarshaller) { this.type = Preconditions.checkNotNull(type, "type"); this.fullMethodName = Preconditions.checkNotNull(fullMethodName, "fullMethodName"); this.requestMarshaller = Preconditions.checkNotNull(requestMarshaller, "requestMarshaller"); @@ -178,7 +178,7 @@ public class MethodDescriptor { * @param input stream containing response message to parse. * @return parsed response message object. */ - public ResponseT parseResponse(InputStream input) { + public RespT parseResponse(InputStream input) { return responseMarshaller.parse(input); } @@ -188,7 +188,7 @@ public class MethodDescriptor { * @param requestMessage to serialize using the request {@link Marshaller}. * @return serialized request message. */ - public InputStream streamRequest(RequestT requestMessage) { + public InputStream streamRequest(ReqT requestMessage) { return requestMarshaller.stream(requestMessage); } @@ -198,7 +198,7 @@ public class MethodDescriptor { * @param input the serialized message as a byte stream. * @return a parsed instance of the message. */ - public RequestT parseRequest(InputStream input) { + public ReqT parseRequest(InputStream input) { return requestMarshaller.parse(input); } @@ -208,7 +208,7 @@ public class MethodDescriptor { * @param response the response message to serialize. * @return the serialized message as a byte stream. */ - public InputStream streamResponse(ResponseT response) { + public InputStream streamResponse(RespT response) { return responseMarshaller.stream(response); } diff --git a/core/src/main/java/io/grpc/ServerCall.java b/core/src/main/java/io/grpc/ServerCall.java index 545a34bd74..0dd16a3eb9 100644 --- a/core/src/main/java/io/grpc/ServerCall.java +++ b/core/src/main/java/io/grpc/ServerCall.java @@ -46,9 +46,9 @@ package io.grpc; * *

Methods are guaranteed to be non-blocking. Implementations are not required to be thread-safe. * - * @param parsed type of response message. + * @param parsed type of response message. */ -public abstract class ServerCall { +public abstract class ServerCall { /** * Callbacks for consuming incoming RPC messages. * @@ -61,14 +61,14 @@ public abstract class ServerCall { // TODO(ejona86): We need to decide what to do in the case of server closing with non-cancellation // before client half closes. It may be that we treat such a case as an error. If we permit such // a case then we either get to generate a half close or purposefully omit it. - public abstract static class Listener { + public abstract static class Listener { /** * A request message has been received. For streaming calls, there may be zero or more request * messages. * * @param message a received request message. */ - public void onMessage(RequestT message) {} + public void onMessage(ReqT message) {} /** * The client completed all message sending. However, the call may still be cancelled. @@ -130,7 +130,7 @@ public abstract class ServerCall { * @param message response message. * @throws IllegalStateException if call is {@link #close}d */ - public abstract void sendMessage(ResponseT message); + public abstract void sendMessage(RespT message); /** * If {@code true}, indicates that the call is capable of sending additional messages diff --git a/core/src/main/java/io/grpc/ServerInterceptor.java b/core/src/main/java/io/grpc/ServerInterceptor.java index d5e4856bf6..566afc9b2b 100644 --- a/core/src/main/java/io/grpc/ServerInterceptor.java +++ b/core/src/main/java/io/grpc/ServerInterceptor.java @@ -61,9 +61,9 @@ public interface ServerInterceptor { * @param next next processor in the interceptor chain * @return listener for processing incoming messages for {@code call}, never {@code null}. */ - ServerCall.Listener interceptCall( - MethodDescriptor method, - ServerCall call, + ServerCall.Listener interceptCall( + MethodDescriptor method, + ServerCall call, Metadata headers, - ServerCallHandler next); + ServerCallHandler next); } diff --git a/core/src/main/java/io/grpc/ServerMethodDefinition.java b/core/src/main/java/io/grpc/ServerMethodDefinition.java index c419a53c77..c91e9c8054 100644 --- a/core/src/main/java/io/grpc/ServerMethodDefinition.java +++ b/core/src/main/java/io/grpc/ServerMethodDefinition.java @@ -34,14 +34,14 @@ package io.grpc; /** * Definition of a method exposed by a {@link Server}. */ -public final class ServerMethodDefinition { - private final MethodDescriptor method; - private final ServerCallHandler handler; +public final class ServerMethodDefinition { + private final MethodDescriptor method; + private final ServerCallHandler handler; // ServerMethodDefinition has no form of public construction. It is only created within the // context of a ServerServiceDefinition.Builder. - ServerMethodDefinition(MethodDescriptor method, - ServerCallHandler handler) { + ServerMethodDefinition(MethodDescriptor method, + ServerCallHandler handler) { this.method = method; this.handler = handler; } @@ -53,19 +53,19 @@ public final class ServerMethodDefinition { * @param handler to dispatch calls to. * @return a new instance. */ - public static ServerMethodDefinition create( - MethodDescriptor method, - ServerCallHandler handler) { - return new ServerMethodDefinition(method, handler); + public static ServerMethodDefinition create( + MethodDescriptor method, + ServerCallHandler handler) { + return new ServerMethodDefinition(method, handler); } /** The {@code MethodDescriptor} for this method. */ - public MethodDescriptor getMethodDescriptor() { + public MethodDescriptor getMethodDescriptor() { return method; } /** Handler for incoming calls. */ - public ServerCallHandler getServerCallHandler() { + public ServerCallHandler getServerCallHandler() { return handler; } @@ -75,8 +75,8 @@ public final class ServerMethodDefinition { * @param handler to bind to a cloned instance of this. * @return a cloned instance of this with the new handler bound. */ - public ServerMethodDefinition withServerCallHandler( - ServerCallHandler handler) { - return new ServerMethodDefinition(method, handler); + public ServerMethodDefinition withServerCallHandler( + ServerCallHandler handler) { + return new ServerMethodDefinition(method, handler); } }