aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/server/GrpcServer.java
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2016-04-12 12:22:20 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2016-04-12 13:59:09 +0000
commite21e592a4079c310522eb2cc23aa49367ba48127 (patch)
tree0a72a4af983e9da7711e954dac27b25b97a26400 /src/main/java/com/google/devtools/build/lib/server/GrpcServer.java
parent1250fdac4c7769cfa200af8b4f9b061024356fea (diff)
Add stub gRPC C++ client and Java server.
The code doesn't do anything yet and it's unused code for now. This change only serves to add all the necessary dependencies to BUILD files that gRPC needs. -- MOS_MIGRATED_REVID=119628697
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/server/GrpcServer.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/server/GrpcServer.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/server/GrpcServer.java b/src/main/java/com/google/devtools/build/lib/server/GrpcServer.java
new file mode 100644
index 0000000000..3674da8a53
--- /dev/null
+++ b/src/main/java/com/google/devtools/build/lib/server/GrpcServer.java
@@ -0,0 +1,31 @@
+// Copyright 2016 The Bazel Authors. All rights reserved.
+//
+// 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 com.google.devtools.build.lib.server;
+
+import io.grpc.stub.StreamObserver;
+
+/**
+ * Unused class just to make sure that we can compile with gRPC.
+ */
+public class GrpcServer implements CommandServerGrpc.CommandServer {
+ @Override
+ public void run(CommandProtos.Request request, StreamObserver<CommandProtos.Response> observer) {
+ CommandProtos.Response response = CommandProtos.Response.newBuilder()
+ .setNumber(request.getNumber() + 1)
+ .build();
+ observer.onNext(response);
+ observer.onCompleted();
+ }
+}