You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2007/03/14 01:38:07 UTC

svn commit: r517953 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: client/OperationClient.java context/MessageContext.java context/ServiceGroupContext.java deployment/RepositoryListener.java

Author: gdaniels
Date: Tue Mar 13 17:38:06 2007
New Revision: 517953

URL: http://svn.apache.org/viewvc?view=rev&rev=517953
Log:
Cleaning up some deprecation warnings.

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java?view=diff&rev=517953&r1=517952&r2=517953
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java Tue Mar 13 17:38:06 2007
@@ -17,6 +17,7 @@
 package org.apache.axis2.client;
 
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.client.async.Callback;
@@ -30,7 +31,6 @@
 import org.apache.axis2.description.TransportOutDescription;
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.util.TargetResolver;
-import org.apache.axis2.util.UUIDGenerator;
 import org.apache.axis2.wsdl.WSDLConstants;
 
 import java.util.Iterator;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java?view=diff&rev=517953&r1=517952&r2=517953
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java Tue Mar 13 17:38:06 2007
@@ -2188,7 +2188,7 @@
             //---------------------------------------------
             // get the soap namespace uri
             //---------------------------------------------
-            String namespaceURI = envelope.getNamespace().getName();
+            String namespaceURI = envelope.getNamespace().getNamespaceURI();
 
             // write out the following information, IN ORDER:
             //           the class name
@@ -2601,7 +2601,7 @@
         String tmpID = getMessageID();
         if (tmpID == null) {
             // get an id to use when restoring this object
-            tmpID = org.apache.axis2.util.UUIDGenerator.getUUID();
+            tmpID = UUIDGenerator.getUUID();
             setMessageID(tmpID);
         }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java?view=diff&rev=517953&r1=517952&r2=517953
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java Tue Mar 13 17:38:06 2007
@@ -26,9 +26,9 @@
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.util.MetaDataEntry;
 import org.apache.axis2.util.ObjectStateUtils;
-import org.apache.axis2.util.UUIDGenerator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.axiom.om.util.UUIDGenerator;
 
 import java.io.Externalizable;
 import java.io.IOException;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java?view=diff&rev=517953&r1=517952&r2=517953
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java Tue Mar 13 17:38:06 2007
@@ -22,6 +22,8 @@
 import org.apache.axis2.util.Loader;
 
 import java.io.File;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.net.URLDecoder;
@@ -29,6 +31,7 @@
 import java.util.Iterator;
 
 public class RepositoryListener implements DeploymentConstants {
+    static String defaultEncoding = new OutputStreamWriter(System.out).getEncoding();
 
     protected DeploymentEngine deploymentEngine;
     private HashMap directoryToExtensionMappingMap;
@@ -37,15 +40,13 @@
      * The parent directory of the modules and services directories
      */
 
-    /**
-     * Reference to a WSInfoList
-     */
+    /** Reference to a WSInfoList */
     protected WSInfoList wsInfoList;
 
     /**
      * This constructor takes two arguments, a folder name and a reference to Deployment Engine
-     * First, it initializes the system, by loading all the modules in the /modules directory
-     * and then creates a WSInfoList to store information about available modules and services.
+     * First, it initializes the system, by loading all the modules in the /modules directory and
+     * then creates a WSInfoList to store information about available modules and services.
      *
      * @param deploymentEngine reference to engine registry for updates
      */
@@ -60,9 +61,7 @@
         loadClassPathModules();
     }
 
-    /**
-     * Finds a list of modules in the folder and adds to wsInfoList.
-     */
+    /** Finds a list of modules in the folder and adds to wsInfoList. */
     public void checkModules() {
         File root = deploymentEngine.getModulesDir();
         File[] files = root.listFiles();
@@ -99,6 +98,9 @@
 
     protected void loadClassPathModules() {
         String classPath = getLocation();
+
+        if (classPath == null) return;
+
         int lstindex = classPath.lastIndexOf(File.separatorChar);
         if (lstindex > 0) {
             classPath = classPath.substring(0, lstindex);
@@ -129,10 +131,12 @@
                     if (path.length() >= 3 && path.charAt(0) == '/' && path.charAt(2) == ':') {
                         path = path.substring(1);
                     }
-                    java.io.File file =
-                            new java.io.File(URLDecoder.decode(urls[i].getPath()).replace('/',
-                                                                                          File.separatorChar).replace(
-                                    '|', ':'));
+                    try {
+                        path = URLDecoder.decode(path, defaultEncoding);
+                    } catch (UnsupportedEncodingException e) {
+                        // Log this?
+                    }
+                    File file = new File(path.replace('/', File.separatorChar).replace('|', ':'));
                     if (file.isFile()) {
                         if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
                             //adding modules in the class path
@@ -166,21 +170,19 @@
                 location = url.toString();
             }
             if (location.startsWith("file")) {
-                java.io.File file = new java.io.File(URLDecoder.decode(url.getPath()).replace('/',
-                                                                                              File.separatorChar).replace(
-                        '|', ':'));
+                String path = URLDecoder.decode(url.getPath(), defaultEncoding);
+                java.io.File file =
+                        new java.io.File(path.replace('/', File.separatorChar).replace('|', ':'));
                 return file.getAbsolutePath();
             } else {
                 return url.toString();
             }
         } catch (Throwable t) {
-            return "an unknown location";
+            return null;
         }
     }
 
-    /**
-     * Finds a list of services in the folder and adds to wsInfoList.
-     */
+    /** Finds a list of services in the folder and adds to wsInfoList. */
     public void checkServices() {
         findServicesInDirectory();
         loadOtherDirectories();
@@ -193,8 +195,8 @@
     }
 
     /**
-     * First initializes the WSInfoList, then calls checkModule to load all the modules
-     * and calls update() to update the Deployment engine and engine registry.
+     * First initializes the WSInfoList, then calls checkModule to load all the modules and calls
+     * update() to update the Deployment engine and engine registry.
      */
     public void init() {
         wsInfoList.init();
@@ -242,10 +244,7 @@
         }
     }
 
-    /**
-     * Searches a given folder for jar files and adds them to a list in the
-     * WSInfolist class.
-     */
+    /** Searches a given folder for jar files and adds them to a list in the WSInfolist class. */
     protected void findServicesInDirectory() {
         File root = deploymentEngine.getServicesDir();
         File[] files = root.listFiles();
@@ -270,9 +269,7 @@
         wsInfoList.addWSInfoItem(null, TYPE_DEFAULT);
     }
 
-    /**
-     * Method invoked from the scheduler to start the listener.
-     */
+    /** Method invoked from the scheduler to start the listener. */
     public void startListener() {
         checkServices();
         loadOtherDirectories();
@@ -284,9 +281,7 @@
         }
     }
 
-    /**
-     * Updates WSInfoList object.
-     */
+    /** Updates WSInfoList object. */
     public void update() throws DeploymentException {
         wsInfoList.update();
     }



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