hudson.model.listeners.ItemListener Java Examples

The following examples show how to use hudson.model.listeners.ItemListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TemplateDrivenMultiBranchProject.java    From multi-branch-project-plugin with MIT License 6 votes vote down vote up
/**
 * 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();
}
 
Example #2
Source File: MockFolder.java    From jenkins-test-harness with MIT License 4 votes vote down vote up
@Override public void onDeleted(TopLevelItem item) throws IOException {
    ItemListener.fireOnDeleted(item);
    items.remove(item.getName());
}
 
Example #3
Source File: MockFolderTest.java    From jenkins-test-harness with MIT License 4 votes vote down vote up
private void assertNews(String expected) {
    L l = j.jenkins.getExtensionList(ItemListener.class).get(L.class);
    assertEquals(expected, l.b.toString().trim());
    l.b.delete(0, l.b.length());
}
 
Example #4
Source File: TestExtensionTest.java    From jenkins-test-harness with MIT License 4 votes vote down vote up
private List<Class<? extends ItemListener>> getExtensionClasses() {
    return j.jenkins.getExtensionList(ItemListener.class).stream().map(ItemListener::getClass).collect(toList());
}