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

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

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

Hudson.getInitLevel介绍

[英]Gets the initialization milestone that we've already reached.
[中]获取我们已经达到的初始化里程碑。

代码示例

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

public InitMilestone getInitLevel() {
  return getHudson().getInitLevel();
}

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

public InitMilestone getInitLevel()
{
  return getHudson().getInitLevel();
}

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

private List<ExtensionComponent<T>> ensureLoaded() {
  if(extensions!=null)
    return extensions; // already loaded
  if(Hudson.getInstance().getInitLevel().compareTo(InitMilestone.PLUGINS_PREPARED)<0)
    return legacyInstances; // can't perform the auto discovery until all plugins are loaded, so just make the legacy instances visible
  synchronized (getLoadLock()) {
    if(extensions==null) {
      List<ExtensionComponent<T>> r = load();
      r.addAll(legacyInstances);
      extensions = sort(r);
    }
    return extensions;
  }
}

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

private List<ExtensionComponent<T>> ensureLoaded() {
  if(extensions!=null)
    return extensions; // already loaded
  if(Hudson.getInstance().getInitLevel().compareTo(InitMilestone.PLUGINS_PREPARED)<0)
    return legacyInstances; // can't perform the auto discovery until all plugins are loaded, so just make the legacy instances visible
  synchronized (getLoadLock()) {
    if(extensions==null) {
      List<ExtensionComponent<T>> r = load();
      r.addAll(legacyInstances);
      extensions = sort(r);
    }
    return extensions;
  }
}

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

private List<ExtensionComponent<T>> ensureLoaded() {
  if(extensions!=null)
    return extensions; // already loaded
  if(Hudson.getInstance().getInitLevel().compareTo(InitMilestone.PLUGINS_PREPARED)<0)
    return legacyInstances; // can't perform the auto discovery until all plugins are loaded, so just make the legacy instances visible
  synchronized (getLoadLock()) {
    if(extensions==null) {
      List<ExtensionComponent<T>> r = load();
      r.addAll(legacyInstances);
      extensions = sort(r);
    }
    return extensions;
  }
}

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

private boolean isReady() {
  // Hudson does not give us a nice InitMilestone when its really ready,
  // but if its not yet COMPLETED, don't bother trying to figure out more
  if (hudson.getInitLevel() != InitMilestone.COMPLETED) {
    return false;
  }
  HudsonFilter filter = HudsonFilter.get(hudson.servletContext);
  if (filter == null) {
    return false;
  }
  // Need to get access to the filter's filter field to see if its actually initialized or not
  // it does not expose it directly, so we have to use reflection to force access
  Filter delegate = getDelegate(filter);
  if (delegate == null) {
    return false;
  }
  // At this point we _should_ be ready, see if the app root object is installed... fingers crossed!
  try {
    Object app = controller.current(); // FIXME: This may actually be the only check needed?
    return app instanceof hudson.model.Hudson;
  } catch (IllegalStateException e) {
    return false; // context not yet available
  }
}

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

private List<ExtensionComponent<T>> ensureLoaded() {
  if (extensions != null) {
    return extensions; // already loaded
  }
  if (Hudson.getInstance().getInitLevel().compareTo(InitMilestone.PLUGINS_PREPARED) < 0) {
    return legacyInstances; // can't perform the auto discovery until all plugins are loaded, so just make the legacy instances visible
  }
  synchronized (getLoadLock()) {
    if (extensions == null) {
      List<ExtensionComponent<T>> r = load();
      r.addAll(legacyInstances);
      extensions = sort(r);
    }
    return extensions;
  }
}

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

private boolean isReady() {
  // Hudson does not give us a nice InitMilestone when its really ready,
  // but if its not yet COMPLETED, don't bother trying to figure out more
  if (hudson.getInitLevel() != InitMilestone.COMPLETED) {
    return false;
  }
  HudsonFilter filter = HudsonFilter.get(hudson.servletContext);
  if (filter == null) {
    return false;
  }
  // Need to get access to the filter's filter field to see if its actually initialized or not
  // it does not expose it directly, so we have to use reflection to force access
  Filter delegate = getDelegate(filter);
  if (delegate == null) {
    return false;
  }
  // At this point we _should_ be ready, see if the app root object is installed... fingers crossed!
  try {
    Object app = controller.current(); // FIXME: This may actually be the only check needed?
    return app instanceof hudson.model.Hudson;
  } catch (IllegalStateException e) {
    return false; // context not yet available
  }
}

相关文章

Hudson类方法