mirror of https://github.com/grpc/grpc-java.git
examples: make JSON code more obviously advanced
This commit is contained in:
parent
3df1446deb
commit
df346e3a86
|
|
@ -46,6 +46,15 @@ import java.util.concurrent.TimeUnit;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
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 {
|
public final class HelloJsonClient {
|
||||||
private static final Logger logger = Logger.getLogger(HelloWorldClient.class.getName());
|
private static final Logger logger = Logger.getLogger(HelloWorldClient.class.getName());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,14 @@ import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Server that manages startup/shutdown of a {@code Greeter} server.
|
* 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 {
|
public class HelloJsonServer {
|
||||||
private static final Logger logger = Logger.getLogger(HelloWorldServer.class.getName());
|
private static final Logger logger = Logger.getLogger(HelloWorldServer.class.getName());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue