javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/jsrpluginnotifier/JsrPluginNotifierBase.java
changeset 87 1627c337e51e
parent 72 1f0034e370aa
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/jsrpluginnotifier/JsrPluginNotifierBase.java	Fri Oct 15 12:29:39 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/jsrpluginnotifier/JsrPluginNotifierBase.java	Fri Oct 29 11:49:32 2010 +0300
@@ -76,6 +76,7 @@
      * about to be installed by calling the install() method of the plugins.
      *
      * @param aInfo notification information object
+     * @throws InstallerExtensionException if thrown from any of the Jsr plugins
      * @throws InstallerException if any of the Jsr plugins cancels installation
      * @see InstallerExtension#install
      */
@@ -83,6 +84,7 @@
     {
         Log.log("JsrPluginNotifierBase.NotifyInstallation called");
         boolean continueInstallation = true;
+        InstallerExtensionException installerExtensionException = null;
         InstallerExtension plugin = null;
         for (int i = 0; i < iJsrPlugins.size(); i++)
         {
@@ -92,6 +94,14 @@
                 Log.log("Jsr plugin install " + plugin.getClass().getName());
                 continueInstallation = plugin.install(aInfo);
             }
+            catch (InstallerExtensionException iee)
+            {
+                installerExtensionException = iee;
+                Log.logError("Installer Jsr plugin " +
+                             plugin.getClass().getName() +
+                             " install exception " + iee, iee);
+                continueInstallation = false;
+            }
             catch (Throwable t)
             {
                 Log.logError("Installer Jsr plugin " +
@@ -104,9 +114,16 @@
             {
                 // Rollback those plugins which already got notified.
                 notifyRollbackInstall(aInfo, i);
-                InstallerException.internalError(
-                    "Jsr plugin " + plugin.getClass().getName() +
-                    " cancelled installation.");
+                if (installerExtensionException != null)
+                {
+                    throw installerExtensionException;
+                }
+                else
+                {
+                    InstallerException.internalError(
+                        "Jsr plugin " + plugin.getClass().getName() +
+                        " cancelled installation.");
+                }
             }
         }
     }
@@ -116,6 +133,7 @@
      * about to be uninstalled by calling the uninstall() method of the plugins.
      *
      * @param aInfo notification information object
+     * @throws InstallerExtensionException if thrown from any of the Jsr plugins
      * @throws InstallerException if any of the Jsr plugins cancels uninstallation
      * @see InstallerExtension#uninstall
      */
@@ -123,6 +141,7 @@
     {
         Log.log("JsrPluginNotifierBase.notifyUninstallation called");
         boolean continueUninstallation = true;
+        InstallerExtensionException installerExtensionException = null;
         InstallerExtension plugin = null;
         for (int i = 0; i < iJsrPlugins.size(); i++)
         {
@@ -132,6 +151,14 @@
                 Log.log("Jsr plugin uninstall " + plugin.getClass().getName());
                 continueUninstallation = plugin.uninstall(aInfo);
             }
+            catch (InstallerExtensionException iee)
+            {
+                installerExtensionException = iee;
+                Log.logError("Installer Jsr plugin " +
+                             plugin.getClass().getName() +
+                             " uninstall exception " + iee, iee);
+                continueUninstallation = false;
+            }
             catch (Throwable t)
             {
                 Log.logError("Installer Jsr plugin " +
@@ -144,9 +171,16 @@
             {
                 // Rollback those plugins which already got notified.
                 notifyRollbackUninstall(aInfo, i);
-                InstallerException.internalError(
-                    "Jsr plugin " + plugin.getClass().getName() +
-                    " cancelled uninstallation.");
+                if (installerExtensionException != null)
+                {
+                    throw installerExtensionException;
+                }
+                else
+                {
+                    InstallerException.internalError(
+                        "Jsr plugin " + plugin.getClass().getName() +
+                        " cancelled uninstallation.");
+                }
             }
         }
     }