aboutsummaryrefslogtreecommitdiff
path: root/stub
diff options
context:
space:
mode:
authorjbingham-google <40675267+jbingham-google@users.noreply.github.com>2018-07-06 18:02:01 -0600
committerEric Anderson <ejona@google.com>2018-07-06 17:02:01 -0700
commit9229e30287db156f334a39a78040059b6ec0294b (patch)
tree808e451ba49202d81039dc8d1c5bb4ec5f28e640 /stub
parentdd57b667cc26212d4494727b1020cdfae4010126 (diff)
downloadgrpc-grpc-java-9229e30287db156f334a39a78040059b6ec0294b.tar.gz
compiler, stub: Add @RpcMethod annotation
This annotation will enable Java APT to generate code. Addresses part of #3173.
Diffstat (limited to 'stub')
-rw-r--r--stub/src/main/java/io/grpc/stub/annotations/RpcMethod.java56
1 files changed, 56 insertions, 0 deletions
diff --git a/stub/src/main/java/io/grpc/stub/annotations/RpcMethod.java b/stub/src/main/java/io/grpc/stub/annotations/RpcMethod.java
new file mode 100644
index 000000000..5d8591f58
--- /dev/null
+++ b/stub/src/main/java/io/grpc/stub/annotations/RpcMethod.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2018 The gRPC Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.grpc.stub.annotations;
+
+import io.grpc.MethodDescriptor.MethodType;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates a method descriptor method to provide metadata for annotation processing.
+ */
+@Retention(RetentionPolicy.CLASS)
+@Target(ElementType.METHOD)
+public @interface RpcMethod {
+
+ /**
+ * The full service name for the method
+ */
+ String fullServiceName();
+
+ /**
+ * The method name for the method
+ */
+ String methodName();
+
+ /**
+ * The input type of the method
+ */
+ Class<?> inputType();
+
+ /**
+ * The output type of the method
+ */
+ Class<?> outputType();
+
+ /**
+ * The call type of the method
+ */
+ MethodType methodType();
+}