code: @CLIMethod(name="restart")
      public void doRestart(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, RestartNotSupportedException {
          checkPermission(ADMINISTER);
          if (req != null && req.getMethod().equals("GET")) {
              req.getView(this,"_restart.jelly").forward(req,rsp);
              return;
          }
  
          if (req == null || req.getMethod().equals("POST")) {
              restart();
          }
  
          if (rsp != null) {
              rsp.sendRedirect2(".");
          }
      }
docs: Perform a restart of Jenkins, if we can.
  
  This first replaces "app" to {@link HudsonIsRestarting}