geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r483678 - 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 21:43:14 GMT
Author: vamsic007
Date: Thu Dec  7 13:43:13 2006
New Revision: 483678

URL: http://svn.apache.org/viewvc?view=rev&rev=483678
Log:
GERONIMO-2584 Hot deploy module/server restart, throws IllegalArgumentException if application
deployed using hotdeployment
  o Integrated the patch provided by Rakesh Midha
  o Patch adds getModuleId in DirectoryHotDeployer, and change calculateModuleId to use it,
also defination of getModuleId is added in listener interface.  Changed calculateModuleId()
to use newly added method getModuleId() from DirectoryHotDeployer. This newly added method
returns configId of deployed application.

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=483678&r1=483677&r2=483678
==============================================================================
--- 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 13:43:13 2006
@@ -352,6 +352,28 @@
         return true;
     }
 
+    public String getModuleId(String config) {
+        DeploymentManager mgr = null;
+        TargetModuleID[] modules = null;
+        try {
+            mgr = getDeploymentManager();
+            Target[] targets = mgr.getTargets();
+            TargetModuleID[] ids = mgr.getAvailableModules(null, targets);
+            for(int j=0;j<ids.length;j++) {
+                String moduleId=ids[j].getModuleID();
+                String[] parts = moduleId.split("/", -1);
+                if (parts.length != 4) {
+                    continue;
+                }
+                if(parts[1] != null && parts[1].equals(config))
+                    return ids[j].getModuleID();                
+            }
+        } catch(Exception ex){
+            log.error("Unable to getModuleId",ex);
+        }
+        return config;
+    }
+
     public void fileUpdated(File file, String configId) {
         log.info("Redeploying " + file.getName());
         DeploymentManager mgr = 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=483678&r1=483677&r2=483678
==============================================================================
--- 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 13:43:13 2006
@@ -104,6 +104,13 @@
         boolean fileRemoved(File file, String configId);
 
         void fileUpdated(File file, String configId);
+
+        /**
+         * This method returns the module id of an application deployed in the default group.
+         * @return String respresenting the ModuleId if the application is already deployed
+         */
+        String getModuleId(String config);
+
     }
 
     private int pollIntervalMillis;
@@ -352,7 +359,7 @@
         }
     }
 
-    private static String calculateModuleId(File module) {
+    private String calculateModuleId(File module) {
         String moduleId = null;
         try {
             moduleId = DeployUtils.extractModuleIdFromArchive(module);
@@ -366,6 +373,7 @@
         if (moduleId == null) {
             int pos = module.getName().lastIndexOf('.');
             moduleId = pos > -1 ? module.getName().substring(0, pos) : module.getName();
+            moduleId = listener.getModuleId(moduleId);
         }
         return moduleId;
     }

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=483678&r1=483677&r2=483678
==============================================================================
--- 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 13:43:13 2006
@@ -353,6 +353,28 @@
         return true;
     }
 
+    public String getModuleId(String config) {
+        DeploymentManager mgr = null;
+        TargetModuleID[] modules = null;
+        try {
+            mgr = getDeploymentManager();
+            Target[] targets = mgr.getTargets();
+            TargetModuleID[] ids = mgr.getAvailableModules(null, targets);
+            for(int j=0;j<ids.length;j++) {
+                String moduleId=ids[j].getModuleID();
+                String[] parts = moduleId.split("/", -1);
+                if (parts.length != 4) {
+                    continue;
+                }
+                if(parts[1] != null && parts[1].equals(config))
+                    return ids[j].getModuleID();                
+            }
+        } catch(Exception ex){
+            log.error("Unable to getModuleId",ex);
+        }
+        return config;
+    }
+
     public void fileUpdated(File file, String configId) {
         log.info("Redeploying " + file.getName());
         DeploymentManager mgr = 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=483678&r1=483677&r2=483678
==============================================================================
--- 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 13:43:13 2006
@@ -104,6 +104,13 @@
         boolean fileRemoved(File file, String configId);
 
         void fileUpdated(File file, String configId);
+
+        /**
+         * This method returns the module id of an application deployed in the default group.
+         * @return String respresenting the ModuleId if the application is already deployed
+         */
+        String getModuleId(String config);
+
     }
 
     private int pollIntervalMillis;
@@ -352,7 +359,7 @@
         }
     }
 
-    private static String calculateModuleId(File module) {
+    private String calculateModuleId(File module) {
         String moduleId = null;
         try {
             moduleId = DeployUtils.extractModuleIdFromArchive(module);
@@ -366,6 +373,7 @@
         if (moduleId == null) {
             int pos = module.getName().lastIndexOf('.');
             moduleId = pos > -1 ? module.getName().substring(0, pos) : module.getName();
+            moduleId = listener.getModuleId(moduleId);
         }
         return moduleId;
     }

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=483678&r1=483677&r2=483678
==============================================================================
--- 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 13:43:13 2006
@@ -353,6 +353,28 @@
         return true;
     }
 
+    public String getModuleId(String config) {
+        DeploymentManager mgr = null;
+        TargetModuleID[] modules = null;
+        try {
+            mgr = getDeploymentManager();
+            Target[] targets = mgr.getTargets();
+            TargetModuleID[] ids = mgr.getAvailableModules(null, targets);
+            for(int j=0;j<ids.length;j++) {
+                String moduleId=ids[j].getModuleID();
+                String[] parts = moduleId.split("/", -1);
+                if (parts.length != 4) {
+                    continue;
+                }
+                if(parts[1] != null && parts[1].equals(config))
+                    return ids[j].getModuleID();                
+            }
+        } catch(Exception ex){
+            log.error("Unable to getModuleId",ex);
+        }
+        return config;
+    }
+
     public void fileUpdated(File file, String configId) {
         log.info("Redeploying " + file.getName());
         DeploymentManager mgr = 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=483678&r1=483677&r2=483678
==============================================================================
--- 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 13:43:13 2006
@@ -104,6 +104,13 @@
         boolean fileRemoved(File file, String configId);
 
         void fileUpdated(File file, String configId);
+
+        /**
+         * This method returns the module id of an application deployed in the default group.
+         * @return String respresenting the ModuleId if the application is already deployed
+         */
+        String getModuleId(String config);
+
     }
 
     private int pollIntervalMillis;
@@ -352,7 +359,7 @@
         }
     }
 
-    private static String calculateModuleId(File module) {
+    private String calculateModuleId(File module) {
         String moduleId = null;
         try {
             moduleId = DeployUtils.extractModuleIdFromArchive(module);
@@ -366,6 +373,7 @@
         if (moduleId == null) {
             int pos = module.getName().lastIndexOf('.');
             moduleId = pos > -1 ? module.getName().substring(0, pos) : module.getName();
+            moduleId = listener.getModuleId(moduleId);
         }
         return moduleId;
     }



Mime
View raw message