/** * Creates a new instance of {@link Hudson}. If the derived class wants to * create it in a different way, you can override it. */ protected Hudson newHudson() throws Exception { File home = homeLoader.allocate(); // Create the Security Manager HudsonSecurityEntitiesHolder.setHudsonSecurityManager(new HudsonSecurityManager(home)); for (Runner r : recipes) { r.decorateHome(this, home); } return new Hudson(home, createWebServer(), useLocalPluginManager ? null : TestPluginManager.INSTANCE); }
@Override public void run() { try { // Creating of the god object performs most of the booting muck Hudson hudson = new Hudson(hudsonHomeDir, servletContext, null, restart); //Now Hudson is fully loaded, reload Hudson Security Manager HudsonSecurityEntitiesHolder.setHudsonSecurityManager(new HudsonSecurityManager(hudsonHomeDir)); // once its done, hook up to stapler and things should be ready to go controller.install(hudson); // trigger the loading of changelogs in the background, // but give the system 10 seconds so that the first page // can be served quickly // Trigger.timer.schedule(new SafeTimerTask() { // public void doRun() { // User.getUnknown().getBuilds(); // } // }, 1000 * 10); } catch (Error e) { logger.error("Failed to initialize Hudson", e); controller.install(new HudsonFailedToLoad(e)); throw e; } catch (Exception e) { logger.error("Failed to initialize Hudson", e); controller.install(new HudsonFailedToLoad(e)); } } }
HudsonSecurityEntitiesHolder.setHudsonSecurityManager(new HudsonSecurityManager(home)); } catch (Exception ex) { ex.printStackTrace();