geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1158898 - /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
Date Wed, 17 Aug 2011 20:42:02 GMT
Author: gawor
Date: Wed Aug 17 20:42:01 2011
New Revision: 1158898

URL: http://svn.apache.org/viewvc?rev=1158898&view=rev
Log:
if every module in osgi application is changed, redeploy the whole application (when update
osgi bundle is enabled)

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java?rev=1158898&r1=1158897&r2=1158898&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
Wed Aug 17 20:42:01 2011
@@ -442,7 +442,7 @@ public class GeronimoServerBehaviourDele
                     ModuleDeltaList moduleList = iterator.next();
                     IModule[] rootModule = moduleList.getRootModule();
                     if (GeronimoUtils.isEBAModule(rootModule[0]) || GeronimoUtils.isEarModule(rootModule[0]))
{
-                        if (moduleList.hasChangedChildModulesOnly()) {
+                        if (moduleList.hasChangedChildModulesOnly(true)) {
                             boolean replacementPossible = true;
                             Map<IModule[], IStatus> statusMap = new HashMap<IModule[],
IStatus>();   
                             
@@ -496,7 +496,7 @@ public class GeronimoServerBehaviourDele
             boolean refreshOSGiBundle = getServerDelegate().isRefreshOSGiBundle();
             for (ModuleDeltaList moduleList : publishMap.values()) {  
                 IModule[] rootModule = moduleList.getRootModule();
-                if (refreshOSGiBundle && GeronimoUtils.isEBAModule(rootModule[0])
&& moduleList.hasChangedChildModulesOnly()) {
+                if (refreshOSGiBundle && GeronimoUtils.isEBAModule(rootModule[0])
&& moduleList.hasChangedChildModulesOnly(false)) {
                     List<IModule[]> changedModules = new ArrayList<IModule[]>();
                     List<IModule[]> unChangedModules = new ArrayList<IModule[]>();
                     for (ModuleDelta moduleDelta : moduleList.getChildModules()) {
@@ -662,21 +662,33 @@ public class GeronimoServerBehaviourDele
             return children;
         }
 
-        public boolean hasChangedChildModulesOnly() {
+        public boolean hasChangedChildModulesOnly(boolean allChangedAllowed) {
+            int changed = getChangedChildModulesOnly();
+            if (allChangedAllowed) {
+                return (changed > 0);
+            } else {
+                return (changed > 0 && changed < children.size());
+            }
+        }
+        
+        /*
+         * Returns number of "changed" child modules. 
+         * Returns -1 if a single "added" or "removed" child module is found or a root module
is modified.
+         */
+        public int getChangedChildModulesOnly() {
             if (root.delta == NO_CHANGE) {
                 int changed = 0;
                 for (ModuleDelta child : children) {
                     if (child.delta == ADDED || child.delta == REMOVED) {
-                        return false;
+                        return -1;
                     } else if (child.delta == CHANGED) {
                         changed++;
                     }
                 }
-                return (changed > 0);          
+                return changed;          
             }
-            return false;
+            return -1;
         }
-        
     }
 
     /*



Mime
View raw message