examples: make JSON code more obviously advanced

This commit is contained in:
Carl Mastrangelo 2016-06-13 12:55:18 -07:00
parent 3df1446deb
commit df346e3a86
2 changed files with 17 additions and 0 deletions

View File

@ -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.
*
* <p>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());

View File

@ -45,6 +45,14 @@ import java.util.logging.Logger;
/**
* Server that manages startup/shutdown of a {@code Greeter} server.
*
* <p>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.
*
* <p>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());