hudson.model.Hudson.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(186)

本文整理了Java中hudson.model.Hudson.<init>()方法的一些代码示例,展示了Hudson.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hudson.<init>()方法的具体详情如下:
包路径:hudson.model.Hudson
类名称:Hudson
方法名:<init>

Hudson.<init>介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/jenkins

@Override
  public void run() {
    boolean success = false;
    try {
      Jenkins instance = new Hudson(_home, context);
      // one last check to make sure everything is in order before we go live
      if (Thread.interrupted())
        throw new InterruptedException();
      context.setAttribute(APP, instance);
      BootFailure.getBootFailureFile(_home).delete();
      // at this point we are open for business and serving requests normally
      LOGGER.info("Jenkins is fully up and running");
      success = true;
    } catch (Error e) {
      new HudsonFailedToLoad(e).publish(context,_home);
      throw e;
    } catch (Exception e) {
      new HudsonFailedToLoad(e).publish(context,_home);
    } finally {
      Jenkins instance = Jenkins.getInstanceOrNull();
      if(!success && instance!=null)
        instance.cleanUp();
    }
  }
};

代码示例来源:origin: org.jvnet.hudson.main/hudson-test-framework

/**
 * 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();
  for (Runner r : recipes)
    r.decorateHome(this,home);
  return new Hudson(home, createWebServer(), useLocalPluginManager ? null : TestPluginManager.INSTANCE);
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-test-harness

/**
 * 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();
  for (Runner r : recipes)
    r.decorateHome(this,home);
  return new Hudson(home, createWebServer(), useLocalPluginManager ? null : TestPluginManager.INSTANCE);
}

代码示例来源:origin: jenkinsci/jenkins-test-harness

/**
 * Creates a new instance of {@link jenkins.model.Jenkins}. 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();
  for (Runner r : recipes)
    r.decorateHome(this,home);
  return new Hudson(home, createWebServer(), useLocalPluginManager ? null : pluginManager);
}

代码示例来源:origin: hudson/hudson-2.x

@Override
  public void run() {
    try {
      // Creating of the god object performs most of the booting muck
      Hudson hudson = new Hudson(home,context);
      // 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.log(Level.SEVERE, "Failed to initialize Hudson",e);
      controller.install(new HudsonFailedToLoad(e));
      throw e;
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, "Failed to initialize Hudson",e);
      controller.install(new HudsonFailedToLoad(e));
    }
  }
}.start();

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

@Override
  public void run() {
    try {
      // Creating of the god object performs most of the booting muck
      Hudson hudson = new Hudson(home,context);
      // 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.log(Level.SEVERE, "Failed to initialize Hudson",e);
      controller.install(new HudsonFailedToLoad(e));
      throw e;
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, "Failed to initialize Hudson",e);
      controller.install(new HudsonFailedToLoad(e));
    }
  }
}.start();

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

@Override
  public void run() {
    try {
      // Creating of the god object performs most of the booting muck
      Hudson hudson = new Hudson(home,context);
      // 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.log(Level.SEVERE, "Failed to initialize Hudson",e);
      controller.install(new HudsonFailedToLoad(e));
      throw e;
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, "Failed to initialize Hudson",e);
      controller.install(new HudsonFailedToLoad(e));
    }
  }
}.start();

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

@Override
  public void run() {
    boolean success = false;
    try {
      Jenkins instance = new Hudson(_home, context);
      // one last check to make sure everything is in order before we go live
      if (Thread.interrupted())
        throw new InterruptedException();
      context.setAttribute(APP, instance);
      BootFailure.getBootFailureFile(_home).delete();
      // at this point we are open for business and serving requests normally
      LOGGER.info("Jenkins is fully up and running");
      success = true;
    } catch (Error e) {
      new HudsonFailedToLoad(e).publish(context,_home);
      throw e;
    } catch (Exception e) {
      new HudsonFailedToLoad(e).publish(context,_home);
    } finally {
      Jenkins instance = Jenkins.getInstanceOrNull();
      if(!success && instance!=null)
        instance.cleanUp();
    }
  }
};

代码示例来源:origin: jenkinsci/jenkinsfile-runner

/**
 * Creates a new instance of {@link jenkins.model.Jenkins}. If the derived class wants to create it in a different way,
 * you can override it.
 */
protected Hudson newHudson() throws Exception {
  jettyLevel(Level.WARNING);
  ServletContext webServer = createWebServer();
  File home = homeLoader.allocate();
  for (JenkinsRecipe.Runner r : recipes) {
    r.decorateHome(this, home);
  }
  try {
    return new Hudson(home, webServer, getPluginManager());
  } catch (InterruptedException x) {
    throw new Exception("Jenkins startup interrupted", x);
  } finally {
    jettyLevel(Level.INFO);
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-test-framework

/**
 * 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);
}

代码示例来源:origin: io.jenkins.jenkinsfile-runner/setup

/**
 * Creates a new instance of {@link jenkins.model.Jenkins}. If the derived class wants to create it in a different way,
 * you can override it.
 */
protected Hudson newHudson() throws Exception {
  jettyLevel(Level.WARNING);
  ServletContext webServer = createWebServer();
  File home = homeLoader.allocate();
  for (JenkinsRecipe.Runner r : recipes) {
    r.decorateHome(this, home);
  }
  try {
    return new Hudson(home, webServer, getPluginManager());
  } catch (InterruptedException x) {
    throw new Exception("Jenkins startup interrupted", x);
  } finally {
    jettyLevel(Level.INFO);
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

@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));
      }
    }
  }

代码示例来源:origin: jenkinsci/jenkins-test-harness

/**
 * Creates a new instance of {@link jenkins.model.Jenkins}. If the derived class wants to create it in a different way,
 * you can override it.
 */
protected Hudson newHudson() throws Exception {
  jettyLevel(Level.WARNING);
  ServletContext webServer = createWebServer();
  File home = homeLoader.allocate();
  for (JenkinsRecipe.Runner r : recipes)
    r.decorateHome(this,home);
  try {
    return new Hudson(home, webServer, getPluginManager());
  } catch (InterruptedException x) {
    throw new AssumptionViolatedException("Jenkins startup interrupted", x);
  } finally {
    jettyLevel(Level.INFO);
  }
}

相关文章

Hudson类方法