diff --git a/core/src/main/java/hudson/model/UpdateSite.java b/core/src/main/java/hudson/model/UpdateSite.java index ee832fc8fc2347a807e4b3fe4dfd80ab39d0651f..f5b5e4beb7345f16277002cc1d3f59c90828f477 100644 --- a/core/src/main/java/hudson/model/UpdateSite.java +++ b/core/src/main/java/hudson/model/UpdateSite.java @@ -218,6 +218,20 @@ public class UpdateSite { return verifySignature(getJSONObject()); } + /** + * Extension point to allow implementations of {@link UpdateSite} to create a custom + * {@link UpdateCenter.InstallationJob}. + * + * @param plugin the plugin to create the {@link UpdateCenter.InstallationJob} for. + * @param uc the {@link UpdateCenter}. + * @param dynamicLoad {@code true} if the plugin should be attempted to be dynamically loaded. + * @return the {@link UpdateCenter.InstallationJob}. + * @since 2.9 + */ + protected UpdateCenter.InstallationJob createInstallationJob(Plugin plugin, UpdateCenter uc, boolean dynamicLoad) { + return uc.new InstallationJob(plugin, this, Jenkins.getAuthentication(), dynamicLoad); + } + /** * Verifies the signature in the update center data file. */ @@ -872,7 +886,7 @@ public class UpdateSite { return enableJob != null ? enableJob : uc.addJob(uc.new NoOpJob(UpdateSite.this, null, this)); } } - UpdateCenter.InstallationJob job = uc.new InstallationJob(this, UpdateSite.this, Jenkins.getAuthentication(), dynamicLoad); + UpdateCenter.InstallationJob job = createInstallationJob(this, uc, dynamicLoad); job.setCorrelationId(correlationId); return uc.addJob(job); }