diff --git a/core/src/main/java/hudson/model/UpdateCenter.java b/core/src/main/java/hudson/model/UpdateCenter.java index 2aa42a635b..5e8db727d7 100644 --- a/core/src/main/java/hudson/model/UpdateCenter.java +++ b/core/src/main/java/hudson/model/UpdateCenter.java @@ -954,10 +954,9 @@ public class UpdateCenter extends AbstractModelObject implements Saveable { LOGGER.info("Installation successful: "+getName()); status = new Success(); onSuccess(); - } catch (RestartRequiredException e) { - status = new SuccessButRequiresRestart(e.message); - LOGGER.log(Level.INFO, "Installation successful but restart required: "+getName(), e); - onSuccess(); + } catch (InstallationStatus e) { + status = e; + if (status.isSuccess()) onSuccess(); } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Failed to install "+getName(),e); status = new Failure(e); @@ -965,7 +964,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable { } } - protected void _run() throws IOException, RestartRequiredException { + protected void _run() throws IOException, InstallationStatus { URL src = getURL(); config.preValidate(this, src); @@ -996,7 +995,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable { *

* Instances of this class is immutable. */ - public abstract class InstallationStatus { + public abstract class InstallationStatus extends Throwable { public final int id = iota.incrementAndGet(); public boolean isSuccess() { return false; @@ -1013,7 +1012,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable { this.problem = problem; } - public String getStackTrace() { + public String getProblemStackTrace() { return Functions.printThrowable(problem); } } @@ -1023,7 +1022,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable { * * @see */ - public class SuccessButRequiresRestart extends InstallationStatus { + public class SuccessButRequiresRestart extends Success { private final Localizable message; public SuccessButRequiresRestart(Localizable message) { @@ -1108,7 +1107,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable { } @Override - public void _run() throws IOException, RestartRequiredException { + public void _run() throws IOException, InstallationStatus { super._run(); // if this is a bundled plugin, make sure it won't get overwritten @@ -1125,10 +1124,12 @@ public class UpdateCenter extends AbstractModelObject implements Saveable { try { pm.dynamicLoad(getDestination()); } catch (RestartRequiredException e) { - throw e; // pass through + throw new SuccessButRequiresRestart(e.message); } catch (Exception e) { throw new IOException2("Failed to dynamically deploy this plugin",e); } + } else { + throw new SuccessButRequiresRestart(Messages._UpdateCenter_DownloadButNotActivated()); } } diff --git a/core/src/main/resources/hudson/PluginManager/table.jelly b/core/src/main/resources/hudson/PluginManager/table.jelly index a16746b0b6..1374ecad01 100644 --- a/core/src/main/resources/hudson/PluginManager/table.jelly +++ b/core/src/main/resources/hudson/PluginManager/table.jelly @@ -137,7 +137,7 @@ THE SOFTWARE.

- +
diff --git a/core/src/main/resources/hudson/model/Messages.properties b/core/src/main/resources/hudson/model/Messages.properties index e8a5c58758..eb3eb2d1cb 100644 --- a/core/src/main/resources/hudson/model/Messages.properties +++ b/core/src/main/resources/hudson/model/Messages.properties @@ -228,6 +228,7 @@ Slave.UnableToLaunch=Unable to launch the slave agent for {0}{1} Slave.UnixSlave=This is a Unix slave Slave.WindowsSlave=This is a Windows slave +UpdateCenter.DownloadButNotActivated=Downloaded Successfully. Will be activated during the next boot View.Permissions.Title=View View.CreatePermission.Description=\ This permission allows users to create new views. diff --git a/core/src/main/resources/hudson/model/UpdateCenter/DownloadJob/Failure/status.jelly b/core/src/main/resources/hudson/model/UpdateCenter/DownloadJob/Failure/status.jelly index d4a3255bf0..1ee9ee5775 100644 --- a/core/src/main/resources/hudson/model/UpdateCenter/DownloadJob/Failure/status.jelly +++ b/core/src/main/resources/hudson/model/UpdateCenter/DownloadJob/Failure/status.jelly @@ -30,5 +30,5 @@ THE SOFTWARE. ${%Details} -
${it.stackTrace}
+
${it.problemStackTrace}
diff --git a/core/src/main/resources/hudson/model/UpdateCenter/body.jelly b/core/src/main/resources/hudson/model/UpdateCenter/body.jelly index a21eee030e..e9a1907ab6 100644 --- a/core/src/main/resources/hudson/model/UpdateCenter/body.jelly +++ b/core/src/main/resources/hudson/model/UpdateCenter/body.jelly @@ -39,7 +39,8 @@ THE SOFTWARE.

- Go back to the top page + ${%Go back to the top page}
+ (you can start using the installed plugins right away)