Revision: 17086
Author: emmartins
Date: Tue Mar  1 22:42:11 2011
Log: Fixes Issue 231
http://code.google.com/p/mobicents/source/detail?r=17086

Modified:
/trunk/servers/jain-slee/core/common/src/main/java/org/mobicents/slee/container/deployment/jboss/DeployableUnit.java

=======================================
--- /trunk/servers/jain-slee/core/common/src/main/java/org/mobicents/slee/container/deployment/jboss/DeployableUnit.java Mon Feb 28 06:56:32 2011 +++ /trunk/servers/jain-slee/core/common/src/main/java/org/mobicents/slee/container/deployment/jboss/DeployableUnit.java Tue Mar 1 22:42:11 2011
@@ -276,18 +276,20 @@
    * @return a Collection of actions.
    */
   public Collection<ManagementAction> getInstallActions() {
- ArrayList<ManagementAction> iActions = new ArrayList<ManagementAction>();
-
-    iActions.addAll(installActions);
-
-    // Let's check if we have some remaining install actions
-    if (postInstallActions.values().size() > 0) {
-      for (String componentId : postInstallActions.keySet()) {
-        iActions.addAll(postInstallActions.get(componentId));
-      }
-    }
-
-    return iActions;
+
+ ArrayList<ManagementAction> iActions = new ArrayList<ManagementAction>();
+
+ // if we have some remaining post install actions it means it is actions related with components already installed
+         // thus should be executed first
+         if (postInstallActions.values().size() > 0) {
+                 for (String componentId : postInstallActions.keySet()) {
+                         iActions.addAll(postInstallActions.get(componentId));
+                 }
+         }
+
+         iActions.addAll(installActions);
+
+         return iActions;
   }

   /**
@@ -295,19 +297,20 @@
    * @return a Collection of actions.
    */
   public Collection<ManagementAction> getUninstallActions() {
- Collection<ManagementAction> uActions = new ArrayList<ManagementAction>(uninstallActions);
-
-    // Let's check if we have some remaining install actions
-    if (preUninstallActions.values().size() > 0) {
-      for (String componentId : preUninstallActions.keySet()) {
-        uActions.addAll(preUninstallActions.get(componentId));
-      }
-    }
-
- // To make sure uninstall is the last action, we add it just when we return them. - uActions.add(new UninstallDeployableUnitAction(diURL.toString(), sleeContainerDeployer.getDeploymentMBean()));
-
-    return uActions;
+ Collection<ManagementAction> uActions = new ArrayList<ManagementAction>(uninstallActions);
+
+         // ensures uninstall is the last action related with DU components
+ uActions.add(new UninstallDeployableUnitAction(diURL.toString(), sleeContainerDeployer.getDeploymentMBean()));
+
+ // if we have some remaining uninstall actions it means it is actions related with components not in DU
+         // thus should be executed last
+         if (preUninstallActions.values().size() > 0) {
+                 for (String componentId : preUninstallActions.keySet()) {
+                         uActions.addAll(preUninstallActions.get(componentId));
+                 }
+         }
+
+         return uActions;
   }

   /**

Reply via email to