当前位置: 首页>>代码示例>>Java>>正文


Java ItemListener类代码示例

本文整理汇总了Java中hudson.model.listeners.ItemListener的典型用法代码示例。如果您正苦于以下问题:Java ItemListener类的具体用法?Java ItemListener怎么用?Java ItemListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ItemListener类属于hudson.model.listeners包,在下文中一共展示了ItemListener类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: submit

import hudson.model.listeners.ItemListener; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:jenkinsci,项目名称:multi-branch-project-plugin,代码行数:26,代码来源:TemplateDrivenMultiBranchProject.java

示例2: newProject

import hudson.model.listeners.ItemListener; //导入依赖的package包/类
/** Instantiate a new project from the json loaded from the DSL file */
private AbstractProject newProject(JSONObject json, String hash)
    throws IOException {
  final YamlProject<T> parent = YamlBuild.this.getParent();
  final String displayName =
      String.format("v%04d", parent.getItems().size());
  final String jobName = String.format("%s-%s", displayName, hash);
  final Binder binder = parent.getModule().getBinder(parent);
  final T project = (T) binder.bindJob(parent, jobName, json);
  project.setDisplayName(displayName);

  // Validate that the embedded project doesn't specify source control,
  // and instate our own DelegateSCM to inject our SCM into it.
  checkState(project.getScm() instanceof NullSCM,
      Messages.YamlBuild_DSLWithSCMError());
  project.setScm(new DelegateSCM(YamlProject.class));

  project.onCreatedFromScratch();
  parent.addItem(project);
  project.save();
  ItemListener.fireOnCreated(project);

  checkNotNull(Jenkins.getInstance()).rebuildDependencyGraph();

  return project;
}
 
开发者ID:jenkinsci,项目名称:yaml-project-plugin,代码行数:27,代码来源:YamlBuild.java

示例3: updateByXml

import hudson.model.listeners.ItemListener; //导入依赖的package包/类
@Override
public void updateByXml(Source source) throws IOException {
	//Check if the job is a transient job; in which case this must fail
	if (this.getIsTransient()) {
		String msg = String.format(
				"Updating %s by XML upload is not allowed: Transient project",
				this.getFullName()
		);
		log.warning(msg);
		throw new IOException(msg);
	}
	
	//Instruct the parent to update us
	super.updateByXml(source);
	//Then, save a new version
	
	clearBuffers(this);
	this.dumpConfigToNewVersion("New version uploaded as XML via API/CLI");
	clearBuffers(this);
	
	//Notify that this project may have changed
	ItemListener.fireOnUpdated(this);
}
 
开发者ID:i-m-c,项目名称:jenkins-inheritance-plugin,代码行数:24,代码来源:InheritanceProject.java

示例4: get

import hudson.model.listeners.ItemListener; //导入依赖的package包/类
/**
 * Gets this extension's instance.
 * 
 * @return the instance of this extension.
 */
public static ItemListenerImpl get() {
    return ItemListener.all().get(ItemListenerImpl.class);
}
 
开发者ID:rinrinne,项目名称:rabbitmq-consumer-plugin,代码行数:9,代码来源:ItemListenerImpl.java


注:本文中的hudson.model.listeners.ItemListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。