hudson.triggers.Trigger.start()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(210)

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

Trigger.start介绍

[英]Called when a Trigger is loaded into memory and started.
[中]当触发器加载到内存并启动时调用。

代码示例

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

@Override public void start(@Nonnull Job project, boolean newInstance) {
  super.start(project, newInstance);
  RunListenerImpl.get().invalidateCache();
}

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

@Override
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException {
  super.onLoad(parent, name);
  if (buildMixIn == null) {
    buildMixIn = createBuildMixIn();
  }
  buildMixIn.onLoad(parent, name);
  builds = buildMixIn.getRunMap();
  triggers().setOwner(this);
  for (Trigger t : triggers()) {
    try {
      t.start(this, Items.currentlyUpdatingByXml());
    } catch (Throwable e) {
      LOGGER.log(Level.WARNING, "could not start trigger while loading project '" + getFullName() + "'", e);
    }
  }
  if(scm==null)
    scm = new NullSCM(); // perhaps it was pointing to a plugin that no longer exists.
  if(transientActions==null)
    transientActions = new Vector<Action>();    // happens when loaded from disk
  updateTransientActions();
}

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

triggers.replaceBy(buildDescribable(req, Trigger.for_(this)));
for (Trigger t : triggers())
  t.start(this,true);

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

public void superStart(J project, boolean newInstance) {
  super.start(project, newInstance);
}

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

public void startTriggers(boolean newInstance) {
  for (Trigger trigger : triggers) {
    try {
      trigger.start(owner, newInstance);
    } catch (Exception ex) {
      LOGGER.log(Level.SEVERE, "Can't start trigger.", ex);
    }
  }
}

代码示例来源:origin: KostyaSha/github-integration-plugin

@Override
public void start(Job<?, ?> project, boolean newInstance) {
  repoName = null; // reset cache
  getRepoProviders().forEach(GitHubRepoProvider::onTriggerStart);
  super.start(project, newInstance);
}

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

@Override public void start(@Nonnull Job project, boolean newInstance) {
  super.start(project, newInstance);
  RunListenerImpl.get().invalidateCache();
}

代码示例来源:origin: io.fabric8.jenkins.plugins/openshift-sync

@Override
public void start(Job<?, ?> job, boolean newInstance) {
 super.start(job, newInstance);
 this.buildConfigProjectProperty = job.getProperty(BuildConfigProjectProperty.class);
 if (this.buildConfigProjectProperty == null) {
  return;
 }
 DESCRIPTOR.addBuildConfigTrigger(buildConfigProjectProperty.getUid(), super.job);
}

代码示例来源:origin: nishio-dens/bitbucket-pullrequest-builder-plugin

@Override
public void start(Job<?, ?> job, boolean newInstance) {
  super.start(job, newInstance);
  try {
    this.bitbucketPullRequestsBuilder = BitbucketPullRequestsBuilder.getBuilder();
    this.bitbucketPullRequestsBuilder.setJob(job);
    this.bitbucketPullRequestsBuilder.setTrigger(this);
    this.bitbucketPullRequestsBuilder.setupBuilder();
  } catch(Exception e) {
    logger.log(Level.SEVERE, "Can't start trigger", e);
    return;
  }
}

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

@Override
public void start(Job<?, ?> project, boolean newInstance) {
  super.start(project, newInstance);
  if (newInstance && GitHubPlugin.configuration().isManageHooks()) {
    registerHooks();
  }
}

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

@Override
public void start(final AbstractProject project, final boolean newInstance) {
  super.start(project, newInstance);
  getDescriptor().dependencyMonitor.subscribe(getProject());
}

代码示例来源:origin: nemccarthy/stash-pullrequest-builder-plugin

@Override
public void start(Job<?, ?> job, boolean newInstance) {
  try {
    this.stashPullRequestsBuilder = StashPullRequestsBuilder.getBuilder();
    this.stashPullRequestsBuilder.setJob(job);
    this.stashPullRequestsBuilder.setTrigger(this);
    this.stashPullRequestsBuilder.setupBuilder();
  } catch(IllegalStateException e) {
    logger.log(Level.SEVERE, "Can't start trigger", e);
    return;
  }
  super.start(job, newInstance);
}

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

@Override
public void start(Job project, boolean newInstance) {
  logger.debug("Start project: {}", project);
  super.start(project, newInstance);
  initializeServerName();
  initializeTriggerOnEvents();
  try {
    addThisTriggerAsListener(project);
  } catch (IllegalStateException e) {
    logger.error("I am too early!", e);
  }
  // Create a new timer task if there is a URL
  if (dynamicTriggerConfiguration) {
    gerritTriggerTimerTask = new GerritTriggerTimerTask(this);
  }
  GerritProjectList.removeTriggerFromProjectList(this);
}

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

@Override
public void start(J project, boolean newInstance) {
  initPython();
  if (pexec.isImplemented(0)) {
    pexec.execPythonVoid("start", project, DataConvertor.fromBool(newInstance));
  } else {
    super.start(project, newInstance);
  }
}

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

public void addTrigger(Trigger trigger) {
  Trigger old = triggers.get(trigger.getDescriptor());
  if (old != null) {
    old.stop();
    triggers.remove(old);
  }
  triggers.add(trigger);
  trigger.start(this, true);
}

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

public void addTrigger(Trigger trigger) {
  Trigger old = triggers.get(trigger.getDescriptor());
  if (old != null) {
    old.stop();
    triggers.remove(old);
  }
  triggers.add(trigger);
  trigger.start(this, true);
}

代码示例来源:origin: timols/jenkins-gitlab-merge-request-builder-plugin

@Override
public void start(AbstractProject<?, ?> project, boolean newInstance) {
  try {
    GitlabWebhooks.addTrigger(this);
    builder = GitlabMergeRequestBuilder.getBuilder()
        .setProject(project)
        .setTrigger(this)
        .setMergeRequests(DESCRIPTOR.getMergeRequests(project.getFullName()))
        .build();
  } catch (IllegalStateException ex) {
    LOGGER.log(Level.SEVERE, "Can't start trigger", ex);
    return;
  }
  super.start(project, newInstance);
}

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

@Override
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException {
  super.onLoad(parent, name);
  if (buildMixIn == null) {
    buildMixIn = createBuildMixIn();
  }
  buildMixIn.onLoad(parent, name);
  builds = buildMixIn.getRunMap();
  triggers().setOwner(this);
  for (Trigger t : triggers()) {
    try {
      t.start(this, Items.currentlyUpdatingByXml());
    } catch (Throwable e) {
      LOGGER.log(Level.WARNING, "could not start trigger while loading project '" + getFullName() + "'", e);
    }
  }
  if(scm==null)
    scm = new NullSCM(); // perhaps it was pointing to a plugin that no longer exists.
  if(transientActions==null)
    transientActions = new Vector<Action>();    // happens when loaded from disk
  updateTransientActions();
}

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

@Override
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException {
  super.onLoad(parent, name);
  this.builds = new RunMap<R>();
  this.builds.load(this, new Constructor<R>() {
    public R create(File dir) throws IOException {
      return loadBuild(dir);
    }
  });
  // boolean! Can't tell if xml file contained false..
  if (enableRemoteTrigger) OldDataMonitor.report(this, "1.77");
  for (Trigger t : getTriggerDescribableList()) {
    t.start(this,false);
  }
  if(scm==null)
    scm = new NullSCM(); // perhaps it was pointing to a plugin that no longer exists.
  if(transientActions==null)
    transientActions = new Vector<Action>();    // happens when loaded from disk
  updateTransientActions();
  getTriggerDescribableList().setOwner(this);
}

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

@Override
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException {
  super.onLoad(parent, name);
  this.builds = new RunMap<R>();
  this.builds.load(this, new Constructor<R>() {
    public R create(File dir) throws IOException {
      return loadBuild(dir);
    }
  });
  // boolean! Can't tell if xml file contained false..
  if (enableRemoteTrigger) OldDataMonitor.report(this, "1.77");
  for (Trigger t : getTriggerDescribableList()) {
    t.start(this,false);
  }
  if(scm==null)
    scm = new NullSCM(); // perhaps it was pointing to a plugin that no longer exists.
  if(transientActions==null)
    transientActions = new Vector<Action>();    // happens when loaded from disk
  updateTransientActions();
  getTriggerDescribableList().setOwner(this);
}

相关文章