geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r483713 - in /geronimo/server: branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/ branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/ trunk/modules/geronimo-hot-deploy/src/mai...
Date Thu, 07 Dec 2006 22:45:46 GMT
Author: vamsic007
Date: Thu Dec  7 14:45:45 2006
New Revision: 483713

URL: http://svn.apache.org/viewvc?view=rev&rev=483713
Log:
GERONIMO-2402 Redeployment fails after third iteration.
  o Integrating the patch provided by Rakesh Midha
  o The Problem is caused by first update operation. The first time hot-deployer tries to
update the changes, it redeployes the application which means the application configid is
changes. This change is not reflected in hotdeployer list. Which mean next time any operation
is done on this application hotdeployer fails because the application configid being used
doesn't exist now.
  o Instead of void the fileUpdated method of DirectoryHotDeployer.java now returns new configId
as string, and in DirectoryMonitor.java this configId is updated in actions fileinfo.

Modified:
    geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
    geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java
    geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
    geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java
    geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
    geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java

Modified: geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java?view=diff&rev=483713&r1=483712&r2=483713
==============================================================================
--- geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
(original)
+++ geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
Thu Dec  7 14:45:45 2006
@@ -374,9 +374,10 @@
         return config;
     }
 
-    public void fileUpdated(File file, String configId) {
+    public String fileUpdated(File file, String configId) {
         log.info("Redeploying " + file.getName());
         DeploymentManager mgr = null;
+        TargetModuleID[] modules = null;
         try {
             mgr = getDeploymentManager();
             Target[] targets = mgr.getTargets();
@@ -390,7 +391,7 @@
             }
             waitForProgress(po);
             if (po.getDeploymentStatus().isCompleted()) {
-                TargetModuleID[] modules = po.getResultTargetModuleIDs();
+                modules = po.getResultTargetModuleIDs();
                 for (int i = 0; i < modules.length; i++) {
                     TargetModuleID result = modules[i];
                     System.out.print(DeployUtils.reformat("Redeployed " + result.getModuleID()
+ (targets.length > 1 ? " to " + result.getTarget().getName() : "") + (result.getWebURL()
== null ? "" : " @ " + result.getWebURL()), 4, 72));
@@ -410,6 +411,15 @@
             log.error("Unable to undeploy", e);
         } finally {
             if (mgr != null) mgr.release();
+        }
+        if (modules != null) {
+            if (modules.length == 1) {
+                return modules[0].getModuleID();
+            } else {
+                return "";
+            }
+        } else {
+            return null;
         }
     }
 

Modified: geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java?view=diff&rev=483713&r1=483712&r2=483713
==============================================================================
--- geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java
(original)
+++ geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java
Thu Dec  7 14:45:45 2006
@@ -103,7 +103,7 @@
          */
         boolean fileRemoved(File file, String configId);
 
-        void fileUpdated(File file, String configId);
+        String fileUpdated(File file, String configId);
 
         /**
          * This method returns the module id of an application deployed in the default group.
@@ -338,7 +338,15 @@
                             }
                         } else if (action.action == FileAction.UPDATED_FILE) {
                             workingOnConfigId = action.info.getConfigId();
-                            listener.fileUpdated(action.child, action.info.getConfigId());
+                            String result = listener.fileUpdated(action.child, action.info.getConfigId());
+                            FileInfo update = action.info;
+                            if (result != null) {
+                                if (!result.equals("")) {
+                                    update.setConfigId(result);
+                                } else {
+                                    update.setConfigId(calculateModuleId(action.child));
+                                }
+                            }
                             workingOnConfigId = null;
                         }
                     } catch (Exception e) {

Modified: geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java?view=diff&rev=483713&r1=483712&r2=483713
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
Thu Dec  7 14:45:45 2006
@@ -375,9 +375,10 @@
         return config;
     }
 
-    public void fileUpdated(File file, String configId) {
+    public String fileUpdated(File file, String configId) {
         log.info("Redeploying " + file.getName());
         DeploymentManager mgr = null;
+        TargetModuleID[] modules = null;
         try {
             mgr = getDeploymentManager();
             Target[] targets = mgr.getTargets();
@@ -391,7 +392,7 @@
             }
             waitForProgress(po);
             if (po.getDeploymentStatus().isCompleted()) {
-                TargetModuleID[] modules = po.getResultTargetModuleIDs();
+                modules = po.getResultTargetModuleIDs();
                 for (int i = 0; i < modules.length; i++) {
                     TargetModuleID result = modules[i];
                     log.info(DeployUtils.reformat("Redeployed " + result.getModuleID() +
(targets.length > 1 ? " to " + result.getTarget().getName() : "") + (result.getWebURL()
== null ? "" : " @ " + result.getWebURL()), 4, 72));
@@ -411,6 +412,15 @@
             log.error("Unable to undeploy", e);
         } finally {
             if (mgr != null) mgr.release();
+        }
+        if (modules != null) {
+            if (modules.length == 1) {
+                return modules[0].getModuleID();
+            } else {
+                return "";
+            }
+        } else {
+            return null;
         }
     }
 

Modified: geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java?view=diff&rev=483713&r1=483712&r2=483713
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java
Thu Dec  7 14:45:45 2006
@@ -103,7 +103,7 @@
          */
         boolean fileRemoved(File file, String configId);
 
-        void fileUpdated(File file, String configId);
+        String fileUpdated(File file, String configId);
 
         /**
          * This method returns the module id of an application deployed in the default group.
@@ -338,7 +338,15 @@
                             }
                         } else if (action.action == FileAction.UPDATED_FILE) {
                             workingOnConfigId = action.info.getConfigId();
-                            listener.fileUpdated(action.child, action.info.getConfigId());
+                            String result = listener.fileUpdated(action.child, action.info.getConfigId());
+                            FileInfo update = action.info;
+                            if (result != null) {
+                                if (!result.equals("")) {
+                                    update.setConfigId(result);
+                                } else {
+                                    update.setConfigId(calculateModuleId(action.child));
+                                }
+                            }
                             workingOnConfigId = null;
                         }
                     } catch (Exception e) {

Modified: geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java?view=diff&rev=483713&r1=483712&r2=483713
==============================================================================
--- geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
(original)
+++ geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
Thu Dec  7 14:45:45 2006
@@ -375,9 +375,10 @@
         return config;
     }
 
-    public void fileUpdated(File file, String configId) {
+    public String fileUpdated(File file, String configId) {
         log.info("Redeploying " + file.getName());
         DeploymentManager mgr = null;
+        TargetModuleID[] modules = null;
         try {
             mgr = getDeploymentManager();
             Target[] targets = mgr.getTargets();
@@ -391,7 +392,7 @@
             }
             waitForProgress(po);
             if (po.getDeploymentStatus().isCompleted()) {
-                TargetModuleID[] modules = po.getResultTargetModuleIDs();
+                modules = po.getResultTargetModuleIDs();
                 for (int i = 0; i < modules.length; i++) {
                     TargetModuleID result = modules[i];
                     log.info(DeployUtils.reformat("Redeployed " + result.getModuleID() +
(targets.length > 1 ? " to " + result.getTarget().getName() : "") + (result.getWebURL()
== null ? "" : " @ " + result.getWebURL()), 4, 72));
@@ -411,6 +412,15 @@
             log.error("Unable to undeploy", e);
         } finally {
             if (mgr != null) mgr.release();
+        }
+        if (modules != null) {
+            if (modules.length == 1) {
+                return modules[0].getModuleID();
+            } else {
+                return "";
+            }
+        } else {
+            return null;
         }
     }
 

Modified: geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java?view=diff&rev=483713&r1=483712&r2=483713
==============================================================================
--- geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java
(original)
+++ geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java
Thu Dec  7 14:45:45 2006
@@ -103,7 +103,7 @@
          */
         boolean fileRemoved(File file, String configId);
 
-        void fileUpdated(File file, String configId);
+        String fileUpdated(File file, String configId);
 
         /**
          * This method returns the module id of an application deployed in the default group.
@@ -338,7 +338,15 @@
                             }
                         } else if (action.action == FileAction.UPDATED_FILE) {
                             workingOnConfigId = action.info.getConfigId();
-                            listener.fileUpdated(action.child, action.info.getConfigId());
+                            String result = listener.fileUpdated(action.child, action.info.getConfigId());
+                            FileInfo update = action.info;
+                            if (result != null) {
+                                if (!result.equals("")) {
+                                    update.setConfigId(result);
+                                } else {
+                                    update.setConfigId(calculateModuleId(action.child));
+                                }
+                            }
                             workingOnConfigId = null;
                         }
                     } catch (Exception e) {



Mime
View raw message