geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r291974 - in /geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal: GeronimoServerBehaviour.java GeronimoUtils.java
Date Tue, 27 Sep 2005 15:19:47 GMT
Author: sppatel
Date: Tue Sep 27 08:19:43 2005
New Revision: 291974

URL: http://svn.apache.org/viewcvs?rev=291974&view=rev
Log:
fix getConfigId(IModule module) and ear undeploy

Modified:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoUtils.java

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java?rev=291974&r1=291973&r2=291974&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
Tue Sep 27 08:19:43 2005
@@ -249,8 +249,9 @@
 
     public void publishModule(int kind, int deltaKind, IModule[] module,
             IProgressMonitor monitor) throws CoreException {
-        
-        Trace.trace(Trace.INFO, "calling publishModule()" + module + " " +  module.length);
+
+        Trace.trace(Trace.INFO, "calling publishModule()" + module + " "
+                + module.length);
 
         _monitor = monitor;
 
@@ -321,7 +322,7 @@
                 Trace.trace(Trace.INFO, "\t" + status.getMessage());
                 _monitor.subTask(status.getMessage());
             }
-            
+
             if (cmd == null || cmd == status.getCommand()) {
                 if (status.isCompleted() || status.isFailed()) {
                     waitThread.interrupt();
@@ -365,21 +366,23 @@
 
     private void invokeCommand(int deltaKind, IModule module)
             throws CoreException {
-        
+
         Trace.trace(Trace.INFO, "calling invokeComand()" + module);
 
         try {
-
             switch (deltaKind) {
             case ADDED: {
+                Trace.trace(Trace.INFO, "calling doDeploy()");
                 doDeploy(module);
                 break;
             }
             case CHANGED: {
-                doReploy(module);
+                Trace.trace(Trace.INFO, "calling doRedeploy()");
+                doRedeploy(module);
                 break;
             }
             case REMOVED: {
+                Trace.trace(Trace.INFO, "calling doUndeploy()");
                 doUndeploy(module);
                 break;
             }
@@ -390,8 +393,6 @@
             e.printStackTrace();
             throw new CoreException(new Status(IStatus.ERROR,
                     GeronimoPlugin.PLUGIN_ID, 0, e.getMessage(), e));
-        } finally {
-
         }
     }
 
@@ -433,7 +434,7 @@
         }
     }
 
-    private void doReploy(IModule module) throws CoreException,
+    private void doRedeploy(IModule module) throws CoreException,
             DeploymentManagerCreationException {
 
         IJ2EEModule j2eeModule = (IJ2EEModule) module.loadAdapter(

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoUtils.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoUtils.java?rev=291974&r1=291973&r2=291974&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoUtils.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoUtils.java
Tue Sep 27 08:19:43 2005
@@ -57,21 +57,24 @@
 
     public static String getConfigId(IModule module) {
 
-        String configId = null;
-
         if (isWebModule(module)) {
-            WebAppType deploymentPlan = getWebDeploymentPlan(module);
-
-            if (deploymentPlan != null)
-                configId = deploymentPlan.getConfigId();
-
-            if (configId == null)
-                configId = getId(module);
+            WebAppType plan = getWebDeploymentPlan(module);
+            if(plan.eIsSet(WebPackage.eINSTANCE.getWebAppType_ConfigId())) {
+                return plan.getConfigId();
+            }
         } else if (isEjbJarModule(module)) {
-            configId = getId(module);
-        }
+            OpenejbJarType plan = getOpenEjbDeploymentPlan(module);
+            if(plan.eIsSet(JarPackage.eINSTANCE.getOpenejbJarType_ConfigId())) {
+                return plan.getConfigId();
+            }
+        } else if(isEarModule(module)) {
+            ApplicationType plan = getApplicationDeploymentPlan(module);
+            if(plan.eIsSet(ApplicationPackage.eINSTANCE.getApplicationType_ConfigId())) {
+                return plan.getConfigId();
+            }
+        } 
 
-        return configId;
+        return getId(module);
     }
 
     public static boolean isWebModule(IModule module) {
@@ -82,12 +85,25 @@
         return "j2ee.ejb".equals(module.getModuleType().getId());
     }
 
+    public static boolean isEarModule(IModule module) {
+        return "j2ee.ear".equals(module.getModuleType().getId());
+    }
+
+    public static boolean isRARModule(IModule module) {
+        return "j2ee.rar".equals(module.getModuleType().getId());
+    }
+
     public static ModuleType getJSR88ModuleType(IModule module) {
         if (isWebModule(module)) {
             return ModuleType.WAR;
         } else if (isEjbJarModule(module)) {
             return ModuleType.EJB;
+        } else if (isEarModule(module)) {
+            return ModuleType.EAR;
+        } else if (isRARModule(module)) {
+            return ModuleType.RAR;
         }
+        Trace.trace(Trace.SEVERE, "getJSR88ModuleType = null");
         return null;
     }
 
@@ -232,6 +248,14 @@
 
     public static WebAppType getWebDeploymentPlan(IModule module) {
         return getWebDeploymentPlan(getVirtualComponent(module));
+    }
+    
+    public static ApplicationType getApplicationDeploymentPlan(IModule module) {
+        return getApplicationDeploymentPlan(getVirtualComponent(module));
+    }
+    
+    public static OpenejbJarType getOpenEjbDeploymentPlan(IModule module) {
+        return getOpenEjbDeploymentPlan(getVirtualComponent(module));
     }
 
     private static IVirtualComponent getVirtualComponent(IModule module) {



Mime
View raw message