@Override
            public void run() {
                // Use stderr here since the logger may have been reset by its JVM shutdown hook.
                System.err.println("*** shutting down gRPC server since JVM is shutting down");
                HelloWorldSimpleServer.this.close();
                System.err.println("*** server shut down");
            }
copy grpc framework
- https://github.com/grpc/grpc-java/blob/master/examples/src/main/java/io/grpc/examples/helloworld/HelloWorldServer.java

Server that manages startup/shutdown of a {@code Greeter} server.
agent-module/plugins-it/google-grpc-it/google-grpc-1-8-it/src/test/java/com/navercorp/pinpoint/it/plugin/grpc/HelloWorldSimpleServer.java