Exemplo n.º 1
0
 public void shutdown(Duration timeout) {
   if (server != null) {
     Future<?> future = server.close();
     try {
       if (timeout != null) {
         future.toJavaFuture().get(timeout.inMillis(), TimeUnit.MILLISECONDS);
       } else {
         future.toJavaFuture().get();
       }
     } catch (Exception e) {
       logger.error("problem shutting down", e);
     }
   }
 }