jenkins.model.Jenkins.rebuildDependencyGraphAsync()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(89)

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

Jenkins.rebuildDependencyGraphAsync介绍

[英]Rebuilds the dependency map asynchronously.

This would keep the UI thread more responsive and helps avoid the deadlocks, as dependency graph recomputation tends to touch a lot of other things.
[中]异步重建依赖关系映射。
这将使UI线程保持更高的响应速度,并有助于避免死锁,因为依赖关系图的重新计算往往会涉及很多其他方面。

代码示例

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

@Override
@RequirePOST
public void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
  super.doConfigSubmit(req,rsp);
  updateTransientActions();
  // notify the queue as the project might be now tied to different node
  Jenkins.getInstance().getQueue().scheduleMaintenance();
  // this is to reflect the upstream build adjustments done above
  Jenkins.getInstance().rebuildDependencyGraphAsync();
}

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

@Override
public void perform(Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException {
  try {
    listener.getLogger().println(Messages.Fingerprinter_Recording());
    Map<String,String> record = new HashMap<String,String>();
    
    EnvVars environment = build.getEnvironment(listener);
    if(targets.length()!=0) {
      String expandedTargets = environment.expand(targets);
      record(build, workspace, listener, record, expandedTargets);
    }
    FingerprintAction fingerprintAction = build.getAction(FingerprintAction.class);
    if (fingerprintAction != null) {
      fingerprintAction.add(record);
    } else {
      build.addAction(new FingerprintAction(build,record));
    }
    if (enableFingerprintsInDependencyGraph) {
      Jenkins.getInstance().rebuildDependencyGraphAsync();
    }
  } catch (IOException e) {
    Functions.printStackTrace(e, listener.error(Messages.Fingerprinter_Failed()));
    build.setResult(Result.FAILURE);
  }
  // failing to record fingerprints is an error but not fatal
}

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

Jenkins.getInstance().rebuildDependencyGraphAsync();

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

Jenkins.getInstance().rebuildDependencyGraphAsync();

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

Jenkins.getInstance().rebuildDependencyGraphAsync();

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

/**
 * Reloads this job from the disk.
 *
 * Exposed through CLI as well.
 *
 * TODO: think about exposing this to UI
 *
 * @since 1.556
 */
@RequirePOST
public void doReload() throws IOException {
  checkPermission(CONFIGURE);
  // try to reflect the changes by reloading
  getConfigFile().unmarshal(this);
  Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<Void, IOException>() {
    @Override
    public Void call() throws IOException {
      onLoad(getParent(), getRootDir().getName());
      return null;
    }
  });
  Jenkins.getInstance().rebuildDependencyGraphAsync();
  SaveableListener.fireOnChange(this, getConfigFile());
}

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

public synchronized TopLevelItem createProject( TopLevelItemDescriptor type, String name, boolean notify )
    throws IOException {
  acl.checkPermission(Item.CREATE);
  type.checkApplicableIn(parent);
  acl.getACL().checkCreatePermission(parent, type);
  Jenkins.getInstance().getProjectNamingStrategy().checkName(name);
  Items.verifyItemDoesNotAlreadyExist(parent, name, null);
  TopLevelItem item = type.newInstance(parent, name);
  item.onCreatedFromScratch();
  item.save();
  add(item);
  Jenkins.getInstance().rebuildDependencyGraphAsync();
  if (notify)
    ItemListener.fireOnCreated(item);
  return item;
}

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

Jenkins.getInstance().rebuildDependencyGraphAsync();

代码示例来源:origin: jenkinsci/maven-plugin

@Override
protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, FormException {
  super.submit(req, rsp);
  reporters.rebuild(req, req.getSubmittedForm(),MavenReporters.getConfigurableList());
  goals = Util.fixEmpty(req.getParameter("goals").trim());
  // dependency setting might have been changed by the user, so rebuild.
  Jenkins.getInstance().rebuildDependencyGraphAsync();
}

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

@Override
@RequirePOST
public void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
  super.doConfigSubmit(req,rsp);
  updateTransientActions();
  // notify the queue as the project might be now tied to different node
  Jenkins.getInstance().getQueue().scheduleMaintenance();
  // this is to reflect the upstream build adjustments done above
  Jenkins.getInstance().rebuildDependencyGraphAsync();
}

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

@Override
public void perform(Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException {
  try {
    listener.getLogger().println(Messages.Fingerprinter_Recording());
    Map<String,String> record = new HashMap<String,String>();
    
    EnvVars environment = build.getEnvironment(listener);
    if(targets.length()!=0) {
      String expandedTargets = environment.expand(targets);
      record(build, workspace, listener, record, expandedTargets);
    }
    FingerprintAction fingerprintAction = build.getAction(FingerprintAction.class);
    if (fingerprintAction != null) {
      fingerprintAction.add(record);
    } else {
      build.addAction(new FingerprintAction(build,record));
    }
    if (enableFingerprintsInDependencyGraph) {
      Jenkins.getInstance().rebuildDependencyGraphAsync();
    }
  } catch (IOException e) {
    Functions.printStackTrace(e, listener.error(Messages.Fingerprinter_Failed()));
    build.setResult(Result.FAILURE);
  }
  // failing to record fingerprints is an error but not fatal
}

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

Jenkins.getInstance().rebuildDependencyGraphAsync();

代码示例来源:origin: jenkinsci/multi-branch-project-plugin

Jenkins.getActiveInstance().rebuildDependencyGraphAsync();

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

Jenkins.getInstance().rebuildDependencyGraphAsync();

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

Jenkins.getInstance().rebuildDependencyGraphAsync();

代码示例来源:origin: jenkinsci/cloudbees-folder-plugin

Jenkins.get().rebuildDependencyGraphAsync();

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

/**
 * Reloads this job from the disk.
 *
 * Exposed through CLI as well.
 *
 * TODO: think about exposing this to UI
 *
 * @since 1.556
 */
@RequirePOST
public void doReload() throws IOException {
  checkPermission(CONFIGURE);
  // try to reflect the changes by reloading
  getConfigFile().unmarshal(this);
  Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<Void, IOException>() {
    @Override
    public Void call() throws IOException {
      onLoad(getParent(), getRootDir().getName());
      return null;
    }
  });
  Jenkins.getInstance().rebuildDependencyGraphAsync();
  SaveableListener.fireOnChange(this, getConfigFile());
}

代码示例来源:origin: jenkinsci/multi-branch-project-plugin

/**
 * Sets various implementation-specific fields and forwards wrapped req/rsp objects on to the
 * {@link #template}'s {@link AbstractProject#doConfigSubmit(StaplerRequest, StaplerResponse)} method.
 * <br>
 * {@inheritDoc}
 */
@Override
public void submit(StaplerRequest req, StaplerResponse rsp)
    throws ServletException, Descriptor.FormException, IOException {
  super.submit(req, rsp);
  makeDisabled(req.getParameter("disable") != null);
  template.doConfigSubmit(
      new TemplateStaplerRequestWrapper(req),
      new TemplateStaplerResponseWrapper(req.getStapler(), rsp));
  ItemListener.fireOnUpdated(this);
  // notify the queue as the project might be now tied to different node
  Jenkins.getActiveInstance().getQueue().scheduleMaintenance();
  // this is to reflect the upstream build adjustments done above
  Jenkins.getActiveInstance().rebuildDependencyGraphAsync();
}

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

public synchronized TopLevelItem createProject( TopLevelItemDescriptor type, String name, boolean notify )
    throws IOException {
  acl.checkPermission(Item.CREATE);
  type.checkApplicableIn(parent);
  acl.getACL().checkCreatePermission(parent, type);
  Jenkins.getInstance().getProjectNamingStrategy().checkName(name);
  Items.verifyItemDoesNotAlreadyExist(parent, name, null);
  TopLevelItem item = type.newInstance(parent, name);
  item.onCreatedFromScratch();
  item.save();
  add(item);
  Jenkins.getInstance().rebuildDependencyGraphAsync();
  if (notify)
    ItemListener.fireOnCreated(item);
  return item;
}

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

Jenkins.getInstance().rebuildDependencyGraphAsync();

相关文章

微信公众号

最新文章

更多

Jenkins类方法