[jboss-cvs] JBossAS SVN: r70030 - projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/dependency.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 22 03:31:33 EST 2008


Author: alesj
Date: 2008-02-22 03:31:32 -0500 (Fri, 22 Feb 2008)
New Revision: 70030

Modified:
   projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/dependency/InstallsAwareAction.java
Log:
Provide a way to override failure behavior. Check if at least one install failed.

Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/dependency/InstallsAwareAction.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/dependency/InstallsAwareAction.java	2008-02-22 07:03:53 UTC (rev 70029)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/dependency/InstallsAwareAction.java	2008-02-22 08:31:32 UTC (rev 70030)
@@ -111,7 +111,7 @@
          }
          catch (Throwable t)
          {
-            doUninstalls(context);
+            considerUninstalls(context, index);
             undoInstallAction(context);
             throw t;
          }
@@ -119,6 +119,25 @@
    }
 
    /**
+    * Consider the uninstalls.
+    *
+    * This method is here to be able to override
+    * the behavior after installs failed.
+    * e.g. perhaps only running uninstalls from the index.
+    *
+    * By default we run all uninstalls in the case
+    * at least one install failed.
+    *
+    * @param context the context
+    * @param index current installs index
+    */
+   protected void considerUninstalls(KernelControllerContext context, int index)
+   {
+      if (index > 0)
+         doUninstalls(context);
+   }
+
+   /**
     * Undo the steps from install action
     * in the case of failed installs.
     * Usually this is what uninstallActionInternal does.




More information about the jboss-cvs-commits mailing list