add support of jvm graceful shutdown