@Override protected int run() throws Exception { Jenkins j = Jenkins.get(); // Or perhaps simpler to inline the thread body of doReload? j.doReload(); Object app; while ((app = WebApp.get(j.servletContext).getApp()) instanceof HudsonIsLoading) { Thread.sleep(100); } if (app instanceof Jenkins) { return 0; } else if (app instanceof JenkinsReloadFailed) { Throwable t = ((JenkinsReloadFailed) app).cause; if (t instanceof Exception) { throw (Exception) t; } else { throw new RuntimeException(t); } } else { stderr.println("Unexpected status " + app); return 1; // could throw JenkinsReloadFailed.cause if it were not deprecated } }
/** * Do we need to show the upgrade wizard prompt? */ public boolean isDue() { if (isUpToDate) return false; // only admin users should see this if (!Jenkins.getInstance().hasPermission(Jenkins.ADMINISTER)) return false; // only show when Jenkins is fully up & running WebApp wa = WebApp.getCurrent(); if (wa==null || !(wa.getApp() instanceof Jenkins)) return false; return System.currentTimeMillis() > SetupWizard.getUpdateStateFile().lastModified(); }
@Override protected int run() throws Exception { Jenkins j = Jenkins.getInstance(); // Or perhaps simpler to inline the thread body of doReload? j.doReload(); Object app; while ((app = WebApp.get(j.servletContext).getApp()) instanceof HudsonIsLoading) { Thread.sleep(100); } if (app instanceof Jenkins) { return 0; } else if (app instanceof JenkinsReloadFailed) { Throwable t = ((JenkinsReloadFailed) app).cause; if (t instanceof Exception) { throw (Exception) t; } else { throw new RuntimeException(t); } } else { stderr.println("Unexpected status " + app); return 1; // could throw JenkinsReloadFailed.cause if it were not deprecated } }
/** * Do we need to show the upgrade wizard prompt? */ public boolean isDue() { if (isUpToDate) return false; // only admin users should see this if (!Jenkins.getInstance().hasPermission(Jenkins.ADMINISTER)) return false; // only show when Jenkins is fully up & running WebApp wa = WebApp.getCurrent(); if (wa==null || !(wa.getApp() instanceof Jenkins)) return false; return System.currentTimeMillis() > SetupWizard.getUpdateStateFile().lastModified(); }
Object root = webApp.getApp(); if(root==null) throw new ServletException("there's no \"app\" attribute in the application context.");
Object root = webApp.getApp(); if(root==null) throw new ServletException("there's no \"app\" attribute in the application context.");
Object root = webApp.getApp(); if(root==null) throw new ServletException("there's no \"app\" attribute in the application context.");