geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1303413 - /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, 21 Mar 2012 14:58:00 GMT
Author: gawor
Date: Wed Mar 21 14:58:00 2012
New Revision: 1303413

URL: http://svn.apache.org/viewvc?rev=1303413&view=rev
Log:
trace module delta info

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=1303413&r1=1303412&r2=1303413&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 Mar 21 14:58:00 2012
@@ -110,6 +110,7 @@ import org.eclipse.wst.server.core.Serve
 import org.eclipse.wst.server.core.internal.IModulePublishHelper;
 import org.eclipse.wst.server.core.internal.ProgressUtil;
 import org.eclipse.wst.server.core.model.IModuleFile;
+import org.eclipse.wst.server.core.model.IModuleFolder;
 import org.eclipse.wst.server.core.model.IModuleResource;
 import org.eclipse.wst.server.core.model.IModuleResourceDelta;
 import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
@@ -378,10 +379,14 @@ public class GeronimoServerBehaviourDele
             modules = (List) list.get(0);
             deltaKind = (List) list.get(1);
             // trace output
-            for (int i = 0; i < modules.size(); i++) {
-                IModule[] module = (IModule[]) modules.get(i);
-                Trace.trace(Trace.INFO, i + " " + Arrays.asList(module).toString() + " "
-                        + deltaKindToString(((Integer) deltaKind.get(i)).intValue()), Activator.traceCore);
+            if (Activator.getDefault().isDebugging()) {
+                for (int i = 0; i < modules.size(); i++) {
+                    IModule[] module = (IModule[]) modules.get(i);
+                    Trace.trace(Trace.INFO, i + " " + Arrays.asList(module).toString() +
" "
+                            + deltaKindToString(((Integer) deltaKind.get(i)).intValue()),
Activator.traceCore);
+                    IModuleResourceDelta[] deltas = getPublishedResourceDelta(module);
+                    traceModuleResourceDelta(deltas, "  ");
+                }
             }
         }
 
@@ -1530,6 +1535,22 @@ public class GeronimoServerBehaviourDele
         return Integer.toString(kind);
     }
     
+    public static void traceModuleResourceDelta(IModuleResourceDelta[] deltaArray, String
tab) {
+        if (deltaArray != null) {
+            for (IModuleResourceDelta delta : deltaArray) {
+                int kind = delta.getKind();        
+                IModuleResource resource = delta.getModuleResource();
+                Trace.trace(Trace.INFO, tab + resource.getName() + "  " + deltaKindToString(kind),
Activator.traceCore);
+                if (resource instanceof IModuleFile) {
+                    // ignore
+                } else if (resource instanceof IModuleFolder) {
+                    IModuleResourceDelta[] childDeltaArray = delta.getAffectedChildren();
+                    traceModuleResourceDelta(childDeltaArray, tab + "  ");
+                }
+            }
+        }
+    }
+    
     public String getConfigId(IModule module) throws Exception {
         return getGeronimoServer().getVersionHandler().getConfigID(module);
     }



Mime
View raw message