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

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

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

Hudson.getInstance介绍

暂无

代码示例

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

@Override
  public <T> Collection<ExtensionComponent<T>> find(Class<T> type) {
    return f.find(type, Hudson.getInstance());
  }
};

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

private void refreshExtensionAnnotations() {
  for (ExtensionComponent<GuiceExtensionAnnotation> ec : moduleFinder.find(GuiceExtensionAnnotation.class, Hudson.getInstance())) {
    GuiceExtensionAnnotation gea = ec.getInstance();
    extensionAnnotations.put(gea.annotationType,gea);
  }
}

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

modules.add(extensions);
for (ExtensionComponent<Module> ec : moduleFinder.find(Module.class, Hudson.getInstance())) {
  modules.add(ec.getInstance());

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

/**
 * Returns true if we should keep going.
 */
protected boolean shouldRun() {
  return Hudson.getInstance() != null && !Hudson.getInstance().isTerminating();
}

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

@Override
  public <T> Collection<ExtensionComponent<T>> find(Class<T> type) {
    return f.find(type, Hudson.getInstance());
  }
};

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

@Override
  protected void onModified() throws IOException {
    super.onModified();
    Hudson.getInstance().trimLabels();
  }
}

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

/**
   * All registered {@link AdministrativeMonitor} instances.
   */
  public static ExtensionList<AdministrativeMonitor> all() {
    return Hudson.getInstance().getExtensionList(AdministrativeMonitor.class);
  }
}

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

@Override
public synchronized void setInstallations(JDK... jdks) {
  List<JDK> list = Hudson.getInstance().getJDKs();
  list.clear();
  list.addAll(Arrays.asList(jdks));
}

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

/**
   * If there's no JDK configured, there's no point in this axis.
   */
  @Override
  public boolean isInstantiable() {
    return !Hudson.getInstance().getJDKs().isEmpty();
  }
}

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

/**
 * Returns all the registered {@link AxisDescriptor}s.
 */
public static DescriptorExtensionList<Axis,AxisDescriptor> all() {
  return Hudson.getInstance().<Axis,AxisDescriptor>getDescriptorList(Axis.class);
}

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

/**
 * Gets the {@link TopLevelItem} of the given name.
 */
public TopLevelItem getItem(String name) {
  return Hudson.getInstance().getItem(name);
}

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

/**
   * Returns all the registered {@link EnvironmentContributor}s.
   */
  public static ExtensionList<EnvironmentContributor> all() {
    return Hudson.getInstance().getExtensionList(EnvironmentContributor.class);
  }
}

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

/**
 * {@inheritDoc}
 */
public JobPropertyDescriptor getDescriptor() {
  return (JobPropertyDescriptor)Hudson.getInstance().getDescriptorOrDie(getClass());
}

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

/**
 * This is where the retrieved file will be stored.
 */
public TextFile getDataFile() {
  return new TextFile(new File(Hudson.getInstance().getRootDir(),"updates/"+id));
}

代码示例来源:origin: org.jenkins-ci.plugins/git

private boolean isCreateAccountBasedOnEmail() {
  Hudson hudson = Hudson.getInstance();
  if (hudson == null) {
    return false;
  }
  DescriptorImpl descriptor = (DescriptorImpl) hudson.getDescriptor(GitSCM.class);
  if (descriptor == null) {
    return false;
  }
  return descriptor.isCreateAccountBasedOnEmail();
}

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

/**
 * If some version of this plugin is currently installed, return {@link PluginWrapper}.
 * Otherwise null.
 */
public PluginWrapper getInstalled() {
  PluginManager pm = Hudson.getInstance().getPluginManager();
  return pm.getPlugin(name);
}

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

/**
 * Finds a resolved method annotated with {@link CLIResolver}.
 */
private Method findResolver(Class type) throws IOException {
  List<Method> resolvers = Util.filter(Index.list(CLIResolver.class, Hudson.getInstance().getPluginManager().uberClassLoader), Method.class);
  for ( ; type!=null; type=type.getSuperclass())
    for (Method m : resolvers)
      if (m.getReturnType()==type)
        return m;
  return null;
}

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

/**
 * Gets the current {@link Computer} that the build is running.
 * This method only works when called during a build, such as by
 * {@link Publisher}, {@link BuildWrapper}, etc.
 */
public static Computer currentComputer() {
  Executor e = Executor.currentExecutor();
  // If no executor then must be on master node
  return e != null ? e.getOwner() : Hudson.getInstance().toComputer();
}

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

@Override
public synchronized void doSubmitDescription( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
  checkPermission(Hudson.ADMINISTER);
  Hudson.getInstance().setSystemMessage(req.getParameter("description"));
  rsp.sendRedirect(".");
}

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

/**
   * Used for CLI binding.
   */
  @CLIResolver
  public static AbstractProject resolveForCLI(
      @Argument(required=true,metaVar="NAME",usage="Job name") String name) throws CmdLineException {
    AbstractProject item = Hudson.getInstance().getItemByFullName(name, AbstractProject.class);
    if (item==null)
      throw new CmdLineException(null,Messages.AbstractItem_NoSuchJobExists(name,AbstractProject.findNearest(name).getFullName()));
    return item;
  }
}

相关文章

Hudson类方法