From df346e3a8614338d46ed9eed7cfad2a4ae1c1dd5 Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Mon, 13 Jun 2016 12:55:18 -0700 Subject: [PATCH] examples: make JSON code more obviously advanced --- .../io/grpc/examples/helloworld/HelloJsonClient.java | 9 +++++++++ .../io/grpc/examples/helloworld/HelloJsonServer.java | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/examples/src/main/java/io/grpc/examples/helloworld/HelloJsonClient.java b/examples/src/main/java/io/grpc/examples/helloworld/HelloJsonClient.java index 6b0f39178a..bc2553cbad 100644 --- a/examples/src/main/java/io/grpc/examples/helloworld/HelloJsonClient.java +++ b/examples/src/main/java/io/grpc/examples/helloworld/HelloJsonClient.java @@ -46,6 +46,15 @@ import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; +/** + * Advanced example of how to swap out the serialization logic. Normal users do not need to do + * this. This code is not intended to be a production-ready implementation, since JSON encoding + * is slow. Additionally, JSON serialization as implemented may be not resilient to malicious + * input. + * + *

If you are considering implementing your own serialization logic, contact the grpc team at + * https://groups.google.com/forum/#!forum/grpc-io + */ public final class HelloJsonClient { private static final Logger logger = Logger.getLogger(HelloWorldClient.class.getName()); diff --git a/examples/src/main/java/io/grpc/examples/helloworld/HelloJsonServer.java b/examples/src/main/java/io/grpc/examples/helloworld/HelloJsonServer.java index 7507f86b54..fbad4e1e25 100644 --- a/examples/src/main/java/io/grpc/examples/helloworld/HelloJsonServer.java +++ b/examples/src/main/java/io/grpc/examples/helloworld/HelloJsonServer.java @@ -45,6 +45,14 @@ import java.util.logging.Logger; /** * Server that manages startup/shutdown of a {@code Greeter} server. + * + *

This is an advanced example of how to swap out the serialization logic. Normal users do not + * need to do this. This code is not intended to be a production-ready implementation, since JSON + * encoding is slow. Additionally, JSON serialization as implemented may be not resilient to + * malicious input. + * + *

If you are considering implementing your own serialization logic, contact the grpc team at + * https://groups.google.com/forum/#!forum/grpc-io */ public class HelloJsonServer { private static final Logger logger = Logger.getLogger(HelloWorldServer.class.getName());