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

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

本文整理了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

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

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

  1. @Override
  2. public void perform(Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException {
  3. try {
  4. listener.getLogger().println(Messages.Fingerprinter_Recording());
  5. Map<String,String> record = new HashMap<String,String>();
  6. EnvVars environment = build.getEnvironment(listener);
  7. if(targets.length()!=0) {
  8. String expandedTargets = environment.expand(targets);
  9. record(build, workspace, listener, record, expandedTargets);
  10. }
  11. FingerprintAction fingerprintAction = build.getAction(FingerprintAction.class);
  12. if (fingerprintAction != null) {
  13. fingerprintAction.add(record);
  14. } else {
  15. build.addAction(new FingerprintAction(build,record));
  16. }
  17. if (enableFingerprintsInDependencyGraph) {
  18. Jenkins.getInstance().rebuildDependencyGraphAsync();
  19. }
  20. } catch (IOException e) {
  21. Functions.printStackTrace(e, listener.error(Messages.Fingerprinter_Failed()));
  22. build.setResult(Result.FAILURE);
  23. }
  24. // failing to record fingerprints is an error but not fatal
  25. }

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

  1. Jenkins.getInstance().rebuildDependencyGraphAsync();

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

  1. Jenkins.getInstance().rebuildDependencyGraphAsync();

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

  1. Jenkins.getInstance().rebuildDependencyGraphAsync();

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

  1. /**
  2. * Reloads this job from the disk.
  3. *
  4. * Exposed through CLI as well.
  5. *
  6. * TODO: think about exposing this to UI
  7. *
  8. * @since 1.556
  9. */
  10. @RequirePOST
  11. public void doReload() throws IOException {
  12. checkPermission(CONFIGURE);
  13. // try to reflect the changes by reloading
  14. getConfigFile().unmarshal(this);
  15. Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<Void, IOException>() {
  16. @Override
  17. public Void call() throws IOException {
  18. onLoad(getParent(), getRootDir().getName());
  19. return null;
  20. }
  21. });
  22. Jenkins.getInstance().rebuildDependencyGraphAsync();
  23. SaveableListener.fireOnChange(this, getConfigFile());
  24. }

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

  1. public synchronized TopLevelItem createProject( TopLevelItemDescriptor type, String name, boolean notify )
  2. throws IOException {
  3. acl.checkPermission(Item.CREATE);
  4. type.checkApplicableIn(parent);
  5. acl.getACL().checkCreatePermission(parent, type);
  6. Jenkins.getInstance().getProjectNamingStrategy().checkName(name);
  7. Items.verifyItemDoesNotAlreadyExist(parent, name, null);
  8. TopLevelItem item = type.newInstance(parent, name);
  9. item.onCreatedFromScratch();
  10. item.save();
  11. add(item);
  12. Jenkins.getInstance().rebuildDependencyGraphAsync();
  13. if (notify)
  14. ItemListener.fireOnCreated(item);
  15. return item;
  16. }

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

  1. Jenkins.getInstance().rebuildDependencyGraphAsync();

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

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

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

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

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

  1. @Override
  2. public void perform(Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException {
  3. try {
  4. listener.getLogger().println(Messages.Fingerprinter_Recording());
  5. Map<String,String> record = new HashMap<String,String>();
  6. EnvVars environment = build.getEnvironment(listener);
  7. if(targets.length()!=0) {
  8. String expandedTargets = environment.expand(targets);
  9. record(build, workspace, listener, record, expandedTargets);
  10. }
  11. FingerprintAction fingerprintAction = build.getAction(FingerprintAction.class);
  12. if (fingerprintAction != null) {
  13. fingerprintAction.add(record);
  14. } else {
  15. build.addAction(new FingerprintAction(build,record));
  16. }
  17. if (enableFingerprintsInDependencyGraph) {
  18. Jenkins.getInstance().rebuildDependencyGraphAsync();
  19. }
  20. } catch (IOException e) {
  21. Functions.printStackTrace(e, listener.error(Messages.Fingerprinter_Failed()));
  22. build.setResult(Result.FAILURE);
  23. }
  24. // failing to record fingerprints is an error but not fatal
  25. }

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

  1. Jenkins.getInstance().rebuildDependencyGraphAsync();

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

  1. Jenkins.getActiveInstance().rebuildDependencyGraphAsync();

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

  1. Jenkins.getInstance().rebuildDependencyGraphAsync();

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

  1. Jenkins.getInstance().rebuildDependencyGraphAsync();

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

  1. Jenkins.get().rebuildDependencyGraphAsync();

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

  1. /**
  2. * Reloads this job from the disk.
  3. *
  4. * Exposed through CLI as well.
  5. *
  6. * TODO: think about exposing this to UI
  7. *
  8. * @since 1.556
  9. */
  10. @RequirePOST
  11. public void doReload() throws IOException {
  12. checkPermission(CONFIGURE);
  13. // try to reflect the changes by reloading
  14. getConfigFile().unmarshal(this);
  15. Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<Void, IOException>() {
  16. @Override
  17. public Void call() throws IOException {
  18. onLoad(getParent(), getRootDir().getName());
  19. return null;
  20. }
  21. });
  22. Jenkins.getInstance().rebuildDependencyGraphAsync();
  23. SaveableListener.fireOnChange(this, getConfigFile());
  24. }

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

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

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

  1. public synchronized TopLevelItem createProject( TopLevelItemDescriptor type, String name, boolean notify )
  2. throws IOException {
  3. acl.checkPermission(Item.CREATE);
  4. type.checkApplicableIn(parent);
  5. acl.getACL().checkCreatePermission(parent, type);
  6. Jenkins.getInstance().getProjectNamingStrategy().checkName(name);
  7. Items.verifyItemDoesNotAlreadyExist(parent, name, null);
  8. TopLevelItem item = type.newInstance(parent, name);
  9. item.onCreatedFromScratch();
  10. item.save();
  11. add(item);
  12. Jenkins.getInstance().rebuildDependencyGraphAsync();
  13. if (notify)
  14. ItemListener.fireOnCreated(item);
  15. return item;
  16. }

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

  1. Jenkins.getInstance().rebuildDependencyGraphAsync();

相关文章

Jenkins类方法