You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ke...@apache.org on 2007/12/14 19:53:18 UTC

svn commit: r604255 - in /webservices/axis2/trunk/java/modules: corba/src/org/apache/axis2/corba/deployer/ kernel/src/org/apache/axis2/deployment/ kernel/src/org/apache/axis2/deployment/repository/util/ kernel/src/org/apache/axis2/deployment/util/ kern...

Author: keithc
Date: Fri Dec 14 10:53:16 2007
New Revision: 604255

URL: http://svn.apache.org/viewvc?rev=604255&view=rev
Log:
Fixing the deployment engine to call the undeploy method with the absolute filename instead of jest the filename. With the pluggable deployers in place and the ability to have them listen to multiple
directories enable having two different axis services having the same filename. Sending the absolute path to the undeploy method solves this issue.


Modified:
    webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/deployer/CorbaDeployer.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java
    webservices/axis2/trunk/java/modules/scripting/src/org/apache/axis2/scripting/ScriptDeploymentEngine.java

Modified: webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/deployer/CorbaDeployer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/deployer/CorbaDeployer.java?rev=604255&r1=604254&r2=604255&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/deployer/CorbaDeployer.java (original)
+++ webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/deployer/CorbaDeployer.java Fri Dec 14 10:53:16 2007
@@ -28,6 +28,7 @@
 import org.apache.axis2.deployment.*;
 import org.apache.axis2.deployment.repository.util.DeploymentFileData;
 import org.apache.axis2.deployment.util.PhasesInfo;
+import org.apache.axis2.deployment.util.Utils;
 import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.MessageReceiver;
@@ -564,6 +565,7 @@
 
     public void unDeploy(String fileName) throws DeploymentException {
         try {
+            fileName = Utils.getShortFileName(fileName);
             axisConfig.removeServiceGroup(fileName);
             log.info(Messages.getMessage(DeploymentErrorMsgs.SERVICE_REMOVED, fileName));
         } catch (AxisFault axisFault) {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java?rev=604255&r1=604254&r2=604255&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java Fri Dec 14 10:53:16 2007
@@ -352,6 +352,7 @@
     }
 
     public void unDeploy(String fileName) {
+        fileName = Utils.getShortFileName(fileName);
         if (fileName.endsWith(".class")) {
             String className = fileName.replaceAll(".class", "");
             try {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java?rev=604255&r1=604254&r2=604255&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java Fri Dec 14 10:53:16 2007
@@ -23,6 +23,7 @@
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.deployment.repository.util.ArchiveReader;
 import org.apache.axis2.deployment.repository.util.DeploymentFileData;
+import org.apache.axis2.deployment.util.Utils;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
@@ -160,6 +161,7 @@
 
     public void unDeploy(String fileName) throws DeploymentException {
         try {
+            fileName = Utils.getShortFileName(fileName);
             fileName = DeploymentEngine.getAxisServiceName(fileName);
             AxisServiceGroup serviceGroup = axisConfig.removeServiceGroup(fileName);
             if (serviceGroup != null) {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java?rev=604255&r1=604254&r2=604255&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java Fri Dec 14 10:53:16 2007
@@ -64,7 +64,7 @@
      * @param file actual jar files for either Module or service
      */
     public synchronized void addWSInfoItem(File file, Deployer deployer , int type) {
-        WSInfo info = (WSInfo) currentJars.get(file.getName());
+        WSInfo info = (WSInfo) currentJars.get(file.getAbsolutePath());
         if (info != null) {
             if (deploymentEngine.isHotUpdate() && isModified(file, info)) {
 //            info.setLastModifiedDate(file.lastModified());
@@ -150,8 +150,8 @@
         String fileName = file.getName();
         WSInfo info = (WSInfo) currentJars.get(fileName);
         if(info==null){
-            info = new WSInfo(file.getName(), file.lastModified(), deployer ,type);
-            currentJars.put(file.getName(), info);
+            info = new WSInfo(file.getAbsolutePath(), file.lastModified(), deployer ,type);
+            currentJars.put(file.getAbsolutePath(), info);
             DeploymentFileData fileData = new DeploymentFileData(file, deployer);
             deploymentEngine.addWSToDeploy(fileData);
         }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java?rev=604255&r1=604254&r2=604255&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java Fri Dec 14 10:53:16 2007
@@ -709,4 +709,8 @@
        return list;
     }
 
+    public static String getShortFileName(String filename){
+        File file = new File(filename);
+        return file.getName();
+    }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java?rev=604255&r1=604254&r2=604255&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java Fri Dec 14 10:53:16 2007
@@ -485,5 +485,5 @@
             result = new AxisFault(soapFault, messageContext);
         }
         return result;
-    }
+    }    
 }

Modified: webservices/axis2/trunk/java/modules/scripting/src/org/apache/axis2/scripting/ScriptDeploymentEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/scripting/src/org/apache/axis2/scripting/ScriptDeploymentEngine.java?rev=604255&r1=604254&r2=604255&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/scripting/src/org/apache/axis2/scripting/ScriptDeploymentEngine.java (original)
+++ webservices/axis2/trunk/java/modules/scripting/src/org/apache/axis2/scripting/ScriptDeploymentEngine.java Fri Dec 14 10:53:16 2007
@@ -18,21 +18,13 @@
  */
 package org.apache.axis2.scripting;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.deployment.DeploymentEngine;
 import org.apache.axis2.deployment.DeploymentErrorMsgs;
 import org.apache.axis2.deployment.DeploymentException;
 import org.apache.axis2.deployment.repository.util.DeploymentFileData;
 import org.apache.axis2.deployment.repository.util.WSInfo;
+import org.apache.axis2.deployment.util.Utils;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
@@ -44,6 +36,15 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
 /**
  * An Axis2 DeploymentEngine subclass for deploying script services 
  * supporting hot deploy and hot update.
@@ -116,10 +117,11 @@
         for (int i = 0; i < wsToUnDeploy.size(); i++) {
             try {
                 WSInfo wsInfo = (WSInfo)wsToUnDeploy.get(i);
+                String fileName = Utils.getShortFileName(wsInfo.getFileName());
 //                if (wsInfo.getType() == TYPE_SERVICE) {
                     if (isHotUpdate()) {
                         try {
-                            serviceName = getAxisServiceName(wsInfo.getFileName());
+                            serviceName = getAxisServiceName(fileName);
                             if (!undeployed.contains(serviceName)) {
                                 realAxisConfig.removeServiceGroup(serviceName);
                                 undeployed.add(serviceName);
@@ -129,11 +131,11 @@
                         } catch (AxisFault axisFault) {
                             // May be a faulty service
                             realAxisConfig.removeFaultyService(serviceName);
-                            log.debug("removeFaultyService: " + wsInfo.getFileName());
+                            log.debug("removeFaultyService: " + fileName);
                         }
                     } else {
                         realAxisConfig.removeFaultyService(serviceName);
-                        log.debug("not hotUpdate, removeFaultyService: " + wsInfo.getFileName());
+                        log.debug("not hotUpdate, removeFaultyService: " + fileName);
                     }
 //                }
             } catch (Exception e) {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org