diff --git a/alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java b/alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java index def37fedb5..012748d110 100644 --- a/alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java +++ b/alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java @@ -31,8 +31,7 @@ public final class HandshakerServiceGrpc { io.grpc.alts.internal.Handshaker.HandshakerResp> getDoHandshakeMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.gcp.HandshakerService", - methodName = "DoHandshake", + fullMethodName = SERVICE_NAME + '/' + "DoHandshake", requestType = io.grpc.alts.internal.Handshaker.HandshakerReq.class, responseType = io.grpc.alts.internal.Handshaker.HandshakerResp.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) diff --git a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java index 77b6ae6a20..6a9da0e8dd 100644 --- a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java +++ b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java @@ -31,8 +31,7 @@ public final class BenchmarkServiceGrpc { io.grpc.benchmarks.proto.Messages.SimpleResponse> getUnaryCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.BenchmarkService", - methodName = "UnaryCall", + fullMethodName = SERVICE_NAME + '/' + "UnaryCall", requestType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, responseType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) @@ -64,8 +63,7 @@ public final class BenchmarkServiceGrpc { io.grpc.benchmarks.proto.Messages.SimpleResponse> getStreamingCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.BenchmarkService", - methodName = "StreamingCall", + fullMethodName = SERVICE_NAME + '/' + "StreamingCall", requestType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, responseType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) @@ -97,8 +95,7 @@ public final class BenchmarkServiceGrpc { io.grpc.benchmarks.proto.Messages.SimpleResponse> getStreamingFromClientMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.BenchmarkService", - methodName = "StreamingFromClient", + fullMethodName = SERVICE_NAME + '/' + "StreamingFromClient", requestType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, responseType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) @@ -130,8 +127,7 @@ public final class BenchmarkServiceGrpc { io.grpc.benchmarks.proto.Messages.SimpleResponse> getStreamingFromServerMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.BenchmarkService", - methodName = "StreamingFromServer", + fullMethodName = SERVICE_NAME + '/' + "StreamingFromServer", requestType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, responseType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) @@ -163,8 +159,7 @@ public final class BenchmarkServiceGrpc { io.grpc.benchmarks.proto.Messages.SimpleResponse> getStreamingBothWaysMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.BenchmarkService", - methodName = "StreamingBothWays", + fullMethodName = SERVICE_NAME + '/' + "StreamingBothWays", requestType = io.grpc.benchmarks.proto.Messages.SimpleRequest.class, responseType = io.grpc.benchmarks.proto.Messages.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) diff --git a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/ReportQpsScenarioServiceGrpc.java b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/ReportQpsScenarioServiceGrpc.java index 1ae1d0160e..4c03b373ce 100644 --- a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/ReportQpsScenarioServiceGrpc.java +++ b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/ReportQpsScenarioServiceGrpc.java @@ -31,8 +31,7 @@ public final class ReportQpsScenarioServiceGrpc { io.grpc.benchmarks.proto.Control.Void> getReportScenarioMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.ReportQpsScenarioService", - methodName = "ReportScenario", + fullMethodName = SERVICE_NAME + '/' + "ReportScenario", requestType = io.grpc.benchmarks.proto.Control.ScenarioResult.class, responseType = io.grpc.benchmarks.proto.Control.Void.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) diff --git a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/WorkerServiceGrpc.java b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/WorkerServiceGrpc.java index 2d9fdabe95..0213533289 100644 --- a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/WorkerServiceGrpc.java +++ b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/WorkerServiceGrpc.java @@ -31,8 +31,7 @@ public final class WorkerServiceGrpc { io.grpc.benchmarks.proto.Control.ServerStatus> getRunServerMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.WorkerService", - methodName = "RunServer", + fullMethodName = SERVICE_NAME + '/' + "RunServer", requestType = io.grpc.benchmarks.proto.Control.ServerArgs.class, responseType = io.grpc.benchmarks.proto.Control.ServerStatus.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) @@ -64,8 +63,7 @@ public final class WorkerServiceGrpc { io.grpc.benchmarks.proto.Control.ClientStatus> getRunClientMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.WorkerService", - methodName = "RunClient", + fullMethodName = SERVICE_NAME + '/' + "RunClient", requestType = io.grpc.benchmarks.proto.Control.ClientArgs.class, responseType = io.grpc.benchmarks.proto.Control.ClientStatus.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) @@ -97,8 +95,7 @@ public final class WorkerServiceGrpc { io.grpc.benchmarks.proto.Control.CoreResponse> getCoreCountMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.WorkerService", - methodName = "CoreCount", + fullMethodName = SERVICE_NAME + '/' + "CoreCount", requestType = io.grpc.benchmarks.proto.Control.CoreRequest.class, responseType = io.grpc.benchmarks.proto.Control.CoreResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) @@ -130,8 +127,7 @@ public final class WorkerServiceGrpc { io.grpc.benchmarks.proto.Control.Void> getQuitWorkerMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.WorkerService", - methodName = "QuitWorker", + fullMethodName = SERVICE_NAME + '/' + "QuitWorker", requestType = io.grpc.benchmarks.proto.Control.Void.class, responseType = io.grpc.benchmarks.proto.Control.Void.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) diff --git a/compiler/src/java_plugin/cpp/java_generator.cpp b/compiler/src/java_plugin/cpp/java_generator.cpp index ecc3df7c36..7d5ba6f356 100644 --- a/compiler/src/java_plugin/cpp/java_generator.cpp +++ b/compiler/src/java_plugin/cpp/java_generator.cpp @@ -478,8 +478,7 @@ static void PrintMethodFields( " $output_type$> $method_new_field_name$;\n" "\n" "@$RpcMethod$(\n" - " fullServiceName = \"$Package$$service_name$\",\n" - " methodName = \"$method_name$\",\n" + " fullMethodName = SERVICE_NAME + '/' + \"$method_name$\",\n" " requestType = $input_type$.class,\n" " responseType = $output_type$.class,\n" " methodType = $MethodType$.$method_type$)\n" diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt index d41733f03e..274de93488 100644 --- a/compiler/src/test/golden/TestService.java.txt +++ b/compiler/src/test/golden/TestService.java.txt @@ -34,8 +34,7 @@ public final class TestServiceGrpc { io.grpc.testing.compiler.Test.SimpleResponse> getUnaryCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.compiler.TestService", - methodName = "UnaryCall", + fullMethodName = SERVICE_NAME + '/' + "UnaryCall", requestType = io.grpc.testing.compiler.Test.SimpleRequest.class, responseType = io.grpc.testing.compiler.Test.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) @@ -67,8 +66,7 @@ public final class TestServiceGrpc { io.grpc.testing.compiler.Test.StreamingOutputCallResponse> getStreamingOutputCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.compiler.TestService", - methodName = "StreamingOutputCall", + fullMethodName = SERVICE_NAME + '/' + "StreamingOutputCall", requestType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, responseType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) @@ -100,8 +98,7 @@ public final class TestServiceGrpc { io.grpc.testing.compiler.Test.StreamingInputCallResponse> getStreamingInputCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.compiler.TestService", - methodName = "StreamingInputCall", + fullMethodName = SERVICE_NAME + '/' + "StreamingInputCall", requestType = io.grpc.testing.compiler.Test.StreamingInputCallRequest.class, responseType = io.grpc.testing.compiler.Test.StreamingInputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) @@ -133,8 +130,7 @@ public final class TestServiceGrpc { io.grpc.testing.compiler.Test.StreamingOutputCallResponse> getFullBidiCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.compiler.TestService", - methodName = "FullBidiCall", + fullMethodName = SERVICE_NAME + '/' + "FullBidiCall", requestType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, responseType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) @@ -166,8 +162,7 @@ public final class TestServiceGrpc { io.grpc.testing.compiler.Test.StreamingOutputCallResponse> getHalfBidiCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.compiler.TestService", - methodName = "HalfBidiCall", + fullMethodName = SERVICE_NAME + '/' + "HalfBidiCall", requestType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, responseType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) @@ -199,8 +194,7 @@ public final class TestServiceGrpc { io.grpc.testing.compiler.Test.StreamingInputCallResponse> getImportMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.compiler.TestService", - methodName = "Import", + fullMethodName = SERVICE_NAME + '/' + "Import", requestType = io.grpc.testing.compiler.Test.StreamingInputCallRequest.class, responseType = io.grpc.testing.compiler.Test.StreamingInputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) diff --git a/compiler/src/testLite/golden/TestService.java.txt b/compiler/src/testLite/golden/TestService.java.txt index 86653f9734..fde613a347 100644 --- a/compiler/src/testLite/golden/TestService.java.txt +++ b/compiler/src/testLite/golden/TestService.java.txt @@ -34,8 +34,7 @@ public final class TestServiceGrpc { io.grpc.testing.compiler.Test.SimpleResponse> getUnaryCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.compiler.TestService", - methodName = "UnaryCall", + fullMethodName = SERVICE_NAME + '/' + "UnaryCall", requestType = io.grpc.testing.compiler.Test.SimpleRequest.class, responseType = io.grpc.testing.compiler.Test.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) @@ -66,8 +65,7 @@ public final class TestServiceGrpc { io.grpc.testing.compiler.Test.StreamingOutputCallResponse> getStreamingOutputCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.compiler.TestService", - methodName = "StreamingOutputCall", + fullMethodName = SERVICE_NAME + '/' + "StreamingOutputCall", requestType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, responseType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) @@ -98,8 +96,7 @@ public final class TestServiceGrpc { io.grpc.testing.compiler.Test.StreamingInputCallResponse> getStreamingInputCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.compiler.TestService", - methodName = "StreamingInputCall", + fullMethodName = SERVICE_NAME + '/' + "StreamingInputCall", requestType = io.grpc.testing.compiler.Test.StreamingInputCallRequest.class, responseType = io.grpc.testing.compiler.Test.StreamingInputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) @@ -130,8 +127,7 @@ public final class TestServiceGrpc { io.grpc.testing.compiler.Test.StreamingOutputCallResponse> getFullBidiCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.compiler.TestService", - methodName = "FullBidiCall", + fullMethodName = SERVICE_NAME + '/' + "FullBidiCall", requestType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, responseType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) @@ -162,8 +158,7 @@ public final class TestServiceGrpc { io.grpc.testing.compiler.Test.StreamingOutputCallResponse> getHalfBidiCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.compiler.TestService", - methodName = "HalfBidiCall", + fullMethodName = SERVICE_NAME + '/' + "HalfBidiCall", requestType = io.grpc.testing.compiler.Test.StreamingOutputCallRequest.class, responseType = io.grpc.testing.compiler.Test.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) @@ -194,8 +189,7 @@ public final class TestServiceGrpc { io.grpc.testing.compiler.Test.StreamingInputCallResponse> getImportMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.compiler.TestService", - methodName = "Import", + fullMethodName = SERVICE_NAME + '/' + "Import", requestType = io.grpc.testing.compiler.Test.StreamingInputCallRequest.class, responseType = io.grpc.testing.compiler.Test.StreamingInputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) diff --git a/core/src/main/java/io/grpc/MethodDescriptor.java b/core/src/main/java/io/grpc/MethodDescriptor.java index 08c072c886..7d006b7968 100644 --- a/core/src/main/java/io/grpc/MethodDescriptor.java +++ b/core/src/main/java/io/grpc/MethodDescriptor.java @@ -365,7 +365,7 @@ public final class MethodDescriptor { } /** - * Generate the fully qualified method name. + * Generate the fully qualified method name. This matches the the name * * @param fullServiceName the fully qualified service name that is prefixed with the package name * @param methodName the short method name diff --git a/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java b/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java index 3107ec6a10..9c1832323e 100644 --- a/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java +++ b/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java @@ -31,8 +31,7 @@ public final class LoadBalancerGrpc { io.grpc.grpclb.LoadBalanceResponse> getBalanceLoadMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.lb.v1.LoadBalancer", - methodName = "BalanceLoad", + fullMethodName = SERVICE_NAME + '/' + "BalanceLoad", requestType = io.grpc.grpclb.LoadBalanceRequest.class, responseType = io.grpc.grpclb.LoadBalanceResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java index 108a54d6b3..124d31e24a 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java @@ -31,8 +31,7 @@ public final class MetricsServiceGrpc { io.grpc.testing.integration.Metrics.GaugeResponse> getGetAllGaugesMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.MetricsService", - methodName = "GetAllGauges", + fullMethodName = SERVICE_NAME + '/' + "GetAllGauges", requestType = io.grpc.testing.integration.Metrics.EmptyMessage.class, responseType = io.grpc.testing.integration.Metrics.GaugeResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) @@ -64,8 +63,7 @@ public final class MetricsServiceGrpc { io.grpc.testing.integration.Metrics.GaugeResponse> getGetGaugeMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.MetricsService", - methodName = "GetGauge", + fullMethodName = SERVICE_NAME + '/' + "GetGauge", requestType = io.grpc.testing.integration.Metrics.GaugeRequest.class, responseType = io.grpc.testing.integration.Metrics.GaugeResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java index 25c4d6f6d7..595aa2a9f0 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java @@ -34,8 +34,7 @@ public final class ReconnectServiceGrpc { io.grpc.testing.integration.EmptyProtos.Empty> getStartMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.ReconnectService", - methodName = "Start", + fullMethodName = SERVICE_NAME + '/' + "Start", requestType = io.grpc.testing.integration.EmptyProtos.Empty.class, responseType = io.grpc.testing.integration.EmptyProtos.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) @@ -67,8 +66,7 @@ public final class ReconnectServiceGrpc { io.grpc.testing.integration.Messages.ReconnectInfo> getStopMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.ReconnectService", - methodName = "Stop", + fullMethodName = SERVICE_NAME + '/' + "Stop", requestType = io.grpc.testing.integration.EmptyProtos.Empty.class, responseType = io.grpc.testing.integration.Messages.ReconnectInfo.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java index 12b7013b2e..727afa039c 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java @@ -35,8 +35,7 @@ public final class TestServiceGrpc { io.grpc.testing.integration.EmptyProtos.Empty> getEmptyCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.TestService", - methodName = "EmptyCall", + fullMethodName = SERVICE_NAME + '/' + "EmptyCall", requestType = io.grpc.testing.integration.EmptyProtos.Empty.class, responseType = io.grpc.testing.integration.EmptyProtos.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) @@ -68,8 +67,7 @@ public final class TestServiceGrpc { io.grpc.testing.integration.Messages.SimpleResponse> getUnaryCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.TestService", - methodName = "UnaryCall", + fullMethodName = SERVICE_NAME + '/' + "UnaryCall", requestType = io.grpc.testing.integration.Messages.SimpleRequest.class, responseType = io.grpc.testing.integration.Messages.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) @@ -101,8 +99,7 @@ public final class TestServiceGrpc { io.grpc.testing.integration.Messages.SimpleResponse> getCacheableUnaryCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.TestService", - methodName = "CacheableUnaryCall", + fullMethodName = SERVICE_NAME + '/' + "CacheableUnaryCall", requestType = io.grpc.testing.integration.Messages.SimpleRequest.class, responseType = io.grpc.testing.integration.Messages.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) @@ -134,8 +131,7 @@ public final class TestServiceGrpc { io.grpc.testing.integration.Messages.StreamingOutputCallResponse> getStreamingOutputCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.TestService", - methodName = "StreamingOutputCall", + fullMethodName = SERVICE_NAME + '/' + "StreamingOutputCall", requestType = io.grpc.testing.integration.Messages.StreamingOutputCallRequest.class, responseType = io.grpc.testing.integration.Messages.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) @@ -167,8 +163,7 @@ public final class TestServiceGrpc { io.grpc.testing.integration.Messages.StreamingInputCallResponse> getStreamingInputCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.TestService", - methodName = "StreamingInputCall", + fullMethodName = SERVICE_NAME + '/' + "StreamingInputCall", requestType = io.grpc.testing.integration.Messages.StreamingInputCallRequest.class, responseType = io.grpc.testing.integration.Messages.StreamingInputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) @@ -200,8 +195,7 @@ public final class TestServiceGrpc { io.grpc.testing.integration.Messages.StreamingOutputCallResponse> getFullDuplexCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.TestService", - methodName = "FullDuplexCall", + fullMethodName = SERVICE_NAME + '/' + "FullDuplexCall", requestType = io.grpc.testing.integration.Messages.StreamingOutputCallRequest.class, responseType = io.grpc.testing.integration.Messages.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) @@ -233,8 +227,7 @@ public final class TestServiceGrpc { io.grpc.testing.integration.Messages.StreamingOutputCallResponse> getHalfDuplexCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.TestService", - methodName = "HalfDuplexCall", + fullMethodName = SERVICE_NAME + '/' + "HalfDuplexCall", requestType = io.grpc.testing.integration.Messages.StreamingOutputCallRequest.class, responseType = io.grpc.testing.integration.Messages.StreamingOutputCallResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) @@ -266,8 +259,7 @@ public final class TestServiceGrpc { io.grpc.testing.integration.EmptyProtos.Empty> getUnimplementedCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.TestService", - methodName = "UnimplementedCall", + fullMethodName = SERVICE_NAME + '/' + "UnimplementedCall", requestType = io.grpc.testing.integration.EmptyProtos.Empty.class, responseType = io.grpc.testing.integration.EmptyProtos.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java index a016796901..0fe86875c4 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java @@ -35,8 +35,7 @@ public final class UnimplementedServiceGrpc { io.grpc.testing.integration.EmptyProtos.Empty> getUnimplementedCallMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.UnimplementedService", - methodName = "UnimplementedCall", + fullMethodName = SERVICE_NAME + '/' + "UnimplementedCall", requestType = io.grpc.testing.integration.EmptyProtos.Empty.class, responseType = io.grpc.testing.integration.EmptyProtos.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) diff --git a/services/src/generated/main/grpc/io/grpc/channelz/v1/ChannelzGrpc.java b/services/src/generated/main/grpc/io/grpc/channelz/v1/ChannelzGrpc.java index abeefb0abe..7150f28371 100644 --- a/services/src/generated/main/grpc/io/grpc/channelz/v1/ChannelzGrpc.java +++ b/services/src/generated/main/grpc/io/grpc/channelz/v1/ChannelzGrpc.java @@ -35,8 +35,7 @@ public final class ChannelzGrpc { io.grpc.channelz.v1.GetTopChannelsResponse> getGetTopChannelsMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.channelz.v1.Channelz", - methodName = "GetTopChannels", + fullMethodName = SERVICE_NAME + '/' + "GetTopChannels", requestType = io.grpc.channelz.v1.GetTopChannelsRequest.class, responseType = io.grpc.channelz.v1.GetTopChannelsResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) @@ -68,8 +67,7 @@ public final class ChannelzGrpc { io.grpc.channelz.v1.GetServersResponse> getGetServersMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.channelz.v1.Channelz", - methodName = "GetServers", + fullMethodName = SERVICE_NAME + '/' + "GetServers", requestType = io.grpc.channelz.v1.GetServersRequest.class, responseType = io.grpc.channelz.v1.GetServersResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) @@ -101,8 +99,7 @@ public final class ChannelzGrpc { io.grpc.channelz.v1.GetServerSocketsResponse> getGetServerSocketsMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.channelz.v1.Channelz", - methodName = "GetServerSockets", + fullMethodName = SERVICE_NAME + '/' + "GetServerSockets", requestType = io.grpc.channelz.v1.GetServerSocketsRequest.class, responseType = io.grpc.channelz.v1.GetServerSocketsResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) @@ -134,8 +131,7 @@ public final class ChannelzGrpc { io.grpc.channelz.v1.GetChannelResponse> getGetChannelMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.channelz.v1.Channelz", - methodName = "GetChannel", + fullMethodName = SERVICE_NAME + '/' + "GetChannel", requestType = io.grpc.channelz.v1.GetChannelRequest.class, responseType = io.grpc.channelz.v1.GetChannelResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) @@ -167,8 +163,7 @@ public final class ChannelzGrpc { io.grpc.channelz.v1.GetSubchannelResponse> getGetSubchannelMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.channelz.v1.Channelz", - methodName = "GetSubchannel", + fullMethodName = SERVICE_NAME + '/' + "GetSubchannel", requestType = io.grpc.channelz.v1.GetSubchannelRequest.class, responseType = io.grpc.channelz.v1.GetSubchannelResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) @@ -200,8 +195,7 @@ public final class ChannelzGrpc { io.grpc.channelz.v1.GetSocketResponse> getGetSocketMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.channelz.v1.Channelz", - methodName = "GetSocket", + fullMethodName = SERVICE_NAME + '/' + "GetSocket", requestType = io.grpc.channelz.v1.GetSocketRequest.class, responseType = io.grpc.channelz.v1.GetSocketResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) diff --git a/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java b/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java index 11ce8dd073..295a747fc9 100644 --- a/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java +++ b/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java @@ -31,8 +31,7 @@ public final class HealthGrpc { io.grpc.health.v1.HealthCheckResponse> getCheckMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.health.v1.Health", - methodName = "Check", + fullMethodName = SERVICE_NAME + '/' + "Check", requestType = io.grpc.health.v1.HealthCheckRequest.class, responseType = io.grpc.health.v1.HealthCheckResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) diff --git a/services/src/generated/main/grpc/io/grpc/reflection/v1alpha/ServerReflectionGrpc.java b/services/src/generated/main/grpc/io/grpc/reflection/v1alpha/ServerReflectionGrpc.java index e67b03a5b0..78f192c3cb 100644 --- a/services/src/generated/main/grpc/io/grpc/reflection/v1alpha/ServerReflectionGrpc.java +++ b/services/src/generated/main/grpc/io/grpc/reflection/v1alpha/ServerReflectionGrpc.java @@ -31,8 +31,7 @@ public final class ServerReflectionGrpc { io.grpc.reflection.v1alpha.ServerReflectionResponse> getServerReflectionInfoMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.reflection.v1alpha.ServerReflection", - methodName = "ServerReflectionInfo", + fullMethodName = SERVICE_NAME + '/' + "ServerReflectionInfo", requestType = io.grpc.reflection.v1alpha.ServerReflectionRequest.class, responseType = io.grpc.reflection.v1alpha.ServerReflectionResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) diff --git a/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherDynamicServiceGrpc.java b/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherDynamicServiceGrpc.java index f38cc3cf24..f50f2b182a 100644 --- a/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherDynamicServiceGrpc.java +++ b/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherDynamicServiceGrpc.java @@ -34,8 +34,7 @@ public final class AnotherDynamicServiceGrpc { io.grpc.reflection.testing.DynamicReply> getMethodMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.reflection.testing.AnotherDynamicService", - methodName = "Method", + fullMethodName = SERVICE_NAME + '/' + "Method", requestType = io.grpc.reflection.testing.DynamicRequest.class, responseType = io.grpc.reflection.testing.DynamicReply.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) diff --git a/services/src/generated/test/grpc/io/grpc/reflection/testing/DynamicServiceGrpc.java b/services/src/generated/test/grpc/io/grpc/reflection/testing/DynamicServiceGrpc.java index a3e5282432..80d28b1b44 100644 --- a/services/src/generated/test/grpc/io/grpc/reflection/testing/DynamicServiceGrpc.java +++ b/services/src/generated/test/grpc/io/grpc/reflection/testing/DynamicServiceGrpc.java @@ -34,8 +34,7 @@ public final class DynamicServiceGrpc { io.grpc.reflection.testing.DynamicReply> getMethodMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.reflection.testing.DynamicService", - methodName = "Method", + fullMethodName = SERVICE_NAME + '/' + "Method", requestType = io.grpc.reflection.testing.DynamicRequest.class, responseType = io.grpc.reflection.testing.DynamicReply.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) diff --git a/services/src/generated/test/grpc/io/grpc/reflection/testing/ReflectableServiceGrpc.java b/services/src/generated/test/grpc/io/grpc/reflection/testing/ReflectableServiceGrpc.java index 45f364c09f..239f944acb 100644 --- a/services/src/generated/test/grpc/io/grpc/reflection/testing/ReflectableServiceGrpc.java +++ b/services/src/generated/test/grpc/io/grpc/reflection/testing/ReflectableServiceGrpc.java @@ -31,8 +31,7 @@ public final class ReflectableServiceGrpc { io.grpc.reflection.testing.Reply> getMethodMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.reflection.testing.ReflectableService", - methodName = "Method", + fullMethodName = SERVICE_NAME + '/' + "Method", requestType = io.grpc.reflection.testing.Request.class, responseType = io.grpc.reflection.testing.Reply.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) diff --git a/stub/src/main/java/io/grpc/stub/annotations/RpcMethod.java b/stub/src/main/java/io/grpc/stub/annotations/RpcMethod.java index 123dc4cd3b..fbf46baed8 100644 --- a/stub/src/main/java/io/grpc/stub/annotations/RpcMethod.java +++ b/stub/src/main/java/io/grpc/stub/annotations/RpcMethod.java @@ -29,8 +29,8 @@ import java.lang.annotation.Target; * *

* This annotation is used by the gRPC stub compiler to annotate {@link MethodDescriptor} - * getters. Users should not annotate their own classes with annotation. Not all stubs may have - * this annotation, so consumers should not assume that it is present. + * getters. Users should not annotate their own classes with this annotation. Not all stubs may + * have this annotation, so consumers should not assume that it is present. *

* * @since 1.14.0 @@ -40,27 +40,31 @@ import java.lang.annotation.Target; public @interface RpcMethod { /** - * The full service name for the method + * The fully qualified method name. This should match the name as returned by + * {@link MethodDescriptor#generateFullMethodName(String, String)}. */ - String fullServiceName(); + String fullMethodName(); /** - * The method name for the method - */ - String methodName(); - - /** - * The request type of the method + * The request type of the method. The request type class should be assignable from (i.e. + * {@link Class#isAssignableFrom(Class)} the request type {@code ReqT} of the + * {@link MethodDescriptor}. Additionally, if the request {@code MethodDescriptor.Marshaller} + * is a {@code MethodDescriptor.ReflectableMarshaller}, the request type should be assignable + * from {@code MethodDescriptor.ReflectableMarshaller#getMessageClass()}. */ Class requestType(); /** - * The response type of the method + * The response type of the method. The response type class should be assignable from (i.e. + * {@link Class#isAssignableFrom(Class)} the response type {@code RespT} of the + * {@link MethodDescriptor}. Additionally, if the response {@code MethodDescriptor.Marshaller} + * is a {@code MethodDescriptor.ReflectableMarshaller}, the response type should be assignable + * from {@code MethodDescriptor.ReflectableMarshaller#getMessageClass()}. */ Class responseType(); /** - * The call type of the method + * The call type of the method. */ MethodDescriptor.MethodType methodType(); } diff --git a/testing-proto/src/generated/main/grpc/io/grpc/testing/protobuf/SimpleServiceGrpc.java b/testing-proto/src/generated/main/grpc/io/grpc/testing/protobuf/SimpleServiceGrpc.java index 6de750227c..96745314f8 100644 --- a/testing-proto/src/generated/main/grpc/io/grpc/testing/protobuf/SimpleServiceGrpc.java +++ b/testing-proto/src/generated/main/grpc/io/grpc/testing/protobuf/SimpleServiceGrpc.java @@ -34,8 +34,7 @@ public final class SimpleServiceGrpc { io.grpc.testing.protobuf.SimpleResponse> getUnaryRpcMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.SimpleService", - methodName = "UnaryRpc", + fullMethodName = SERVICE_NAME + '/' + "UnaryRpc", requestType = io.grpc.testing.protobuf.SimpleRequest.class, responseType = io.grpc.testing.protobuf.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) @@ -67,8 +66,7 @@ public final class SimpleServiceGrpc { io.grpc.testing.protobuf.SimpleResponse> getClientStreamingRpcMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.SimpleService", - methodName = "ClientStreamingRpc", + fullMethodName = SERVICE_NAME + '/' + "ClientStreamingRpc", requestType = io.grpc.testing.protobuf.SimpleRequest.class, responseType = io.grpc.testing.protobuf.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) @@ -100,8 +98,7 @@ public final class SimpleServiceGrpc { io.grpc.testing.protobuf.SimpleResponse> getServerStreamingRpcMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.SimpleService", - methodName = "ServerStreamingRpc", + fullMethodName = SERVICE_NAME + '/' + "ServerStreamingRpc", requestType = io.grpc.testing.protobuf.SimpleRequest.class, responseType = io.grpc.testing.protobuf.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) @@ -133,8 +130,7 @@ public final class SimpleServiceGrpc { io.grpc.testing.protobuf.SimpleResponse> getBidiStreamingRpcMethod; @io.grpc.stub.annotations.RpcMethod( - fullServiceName = "grpc.testing.SimpleService", - methodName = "BidiStreamingRpc", + fullMethodName = SERVICE_NAME + '/' + "BidiStreamingRpc", requestType = io.grpc.testing.protobuf.SimpleRequest.class, responseType = io.grpc.testing.protobuf.SimpleResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)