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 du...@apache.org on 2007/03/01 16:12:02 UTC

svn commit: r513373 - in /webservices/axis/trunk/proposals/dug/java/src/org/apache/axis: ./ components/uuid/ configuration/ encoding/ encoding/ser/ handlers/

Author: dug
Date: Thu Mar  1 07:12:00 2007
New Revision: 513373

URL: http://svn.apache.org/viewvc?view=rev&rev=513373
Log:
sync with head

Modified:
    webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/ConfigurationException.java
    webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/components/uuid/FastUUIDGen.java
    webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/configuration/DirProvider.java
    webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/encoding/TypeMappingImpl.java
    webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/encoding/ser/BeanSerializer.java
    webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/handlers/HandlerChainImpl.java
    webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/handlers/LogHandler.java

Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/ConfigurationException.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/ConfigurationException.java?view=diff&rev=513373&r1=513372&r2=513373
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/ConfigurationException.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/ConfigurationException.java Thu Mar  1 07:12:00 2007
@@ -70,6 +70,15 @@
     }
 
     /**
+     * Construct a ConfigurationException from an Exception.
+     * @param message custom error message
+     * @param exception original exception which was unexpected
+     */
+    public ConfigurationException(String message, Exception exception) {
+        this(message, exception, copyStackByDefault);
+    }
+
+    /**
      * Stringify, including stack trace.
      *
      * @return a <code>String</code> view of this object
@@ -89,9 +98,20 @@
      * @param exception original exception which was unexpected
      * @param copyStack set to true to copy the orginal exception's stack
      */
-    public ConfigurationException(Exception exception, final boolean copyStack) {
-        super(exception.toString()  + (copyStack ? "\n"
-           + JavaUtils.stackToString(exception) : "" ));
+    public ConfigurationException(Exception exception, boolean copyStack) {
+        this(null, exception, copyStack);
+    }
+
+    /**
+     * Construct a ConfigurationException from an Exception.
+     * @param message custom error message
+     * @param exception original exception which was unexpected
+     * @param copyStack set to true to copy the orginal exception's stack
+     */
+    public ConfigurationException(String message, Exception exception, final boolean copyStack) {
+        super((message != null ? message + "\n" : "") + 
+              exception.toString() +
+              (copyStack ? "\n" + JavaUtils.stackToString(exception) : "" ));
         containedException = exception;
         if(copyStack) {
             stackTrace = JavaUtils.stackToString(this);

Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/components/uuid/FastUUIDGen.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/components/uuid/FastUUIDGen.java?view=diff&rev=513373&r1=513372&r2=513373
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/components/uuid/FastUUIDGen.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/components/uuid/FastUUIDGen.java Thu Mar  1 07:12:00 2007
@@ -30,7 +30,7 @@
     private static String nodeStr;
     private static int clockSequence;
 
-    private long lastTime = 0;
+    private static long lastTime = 0;
 
     static {
         // problem: the node should be the IEEE 802 ethernet address, but can not
@@ -78,19 +78,22 @@
         timestamp += 0x01b21dd2L << 32;
         timestamp += 0x13814000;
         
-        synchronized(this) {
-            if (time - lastTime <= 0) {
+        long localClockSequence;
+
+        synchronized(FastUUIDGen.class) {
+            if (time <= lastTime) {
                 clockSequence = ((clockSequence + 1) & 16383);
             }
             lastTime = time;
+            localClockSequence = clockSequence;
         }
 
         long timeLow = getBitsValue(timestamp, 32, 32);
         long timeMid = getBitsValue(timestamp, 48, 16);
         long timeHi = getBitsValue(timestamp, 64, 16) | 0x1000;
 
-        long clockSeqLow = getBitsValue(clockSequence, 8, 8);
-        long clockSeqHi = getBitsValue(clockSequence, 16, 8) | 0x80;
+        long clockSeqLow = getBitsValue(localClockSequence, 8, 8);
+        long clockSeqHi = getBitsValue(localClockSequence, 16, 8) | 0x80;
         
         String timeLowStr = leftZeroPadString(Long.toHexString(timeLow), 8);
         String timeMidStr = leftZeroPadString(Long.toHexString(timeMid), 4);

Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/configuration/DirProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/configuration/DirProvider.java?view=diff&rev=513373&r1=513372&r2=513373
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/configuration/DirProvider.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/configuration/DirProvider.java Thu Mar  1 07:12:00 2007
@@ -116,7 +116,9 @@
             WSDDDocument doc = new WSDDDocument(XMLUtils.newDocument(in));
             doc.deploy(this.deployment);
         } catch (Exception e) {
-            throw new ConfigurationException(e);
+            String err = "Error processing configuration file: " 
+                + file.getAbsolutePath();
+            throw new ConfigurationException(err, e, false);
         } finally {
             if (in != null) {
                 try {

Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/encoding/TypeMappingImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/encoding/TypeMappingImpl.java?view=diff&rev=513373&r1=513372&r2=513373
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/encoding/TypeMappingImpl.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/encoding/TypeMappingImpl.java Thu Mar  1 07:12:00 2007
@@ -40,7 +40,9 @@
 
 import java.lang.reflect.Array;
 import java.util.ArrayList;
+import java.util.Map;
 import java.util.HashMap;
+import java.util.Collections;
 import java.util.List;
 import java.io.Serializable;
 
@@ -115,10 +117,10 @@
         }
     }
 
-    private HashMap qName2Pair;     // QName to Pair Mapping
-    private HashMap class2Pair;     // Class Name to Pair Mapping
-    private HashMap pair2SF;        // Pair to Serialization Factory
-    private HashMap pair2DF;        // Pair to Deserialization Factory
+    private Map qName2Pair;     // QName to Pair Mapping
+    private Map class2Pair;     // Class Name to Pair Mapping
+    private Map pair2SF;        // Pair to Serialization Factory
+    private Map pair2DF;        // Pair to Deserialization Factory
     private ArrayList namespaces;   // Supported namespaces
 
     protected Boolean doAutoTypes = null;
@@ -127,10 +129,10 @@
      * Construct TypeMapping
      */
     public TypeMappingImpl() {
-        qName2Pair  = new HashMap();
-        class2Pair  = new HashMap();
-        pair2SF     = new HashMap();
-        pair2DF     = new HashMap();
+        qName2Pair  = Collections.synchronizedMap(new HashMap());
+        class2Pair  = Collections.synchronizedMap(new HashMap());
+        pair2SF     = Collections.synchronizedMap(new HashMap());
+        pair2DF     = Collections.synchronizedMap(new HashMap());
         namespaces  = new ArrayList();
     }
 
@@ -779,4 +781,4 @@
         temp.addAll(class2Pair.keySet());
         return (Class[])temp.toArray(new Class[temp.size()]);
     }
-}
\ No newline at end of file
+}

Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/encoding/ser/BeanSerializer.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/encoding/ser/BeanSerializer.java?view=diff&rev=513373&r1=513372&r2=513373
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/encoding/ser/BeanSerializer.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/encoding/ser/BeanSerializer.java Thu Mar  1 07:12:00 2007
@@ -18,6 +18,7 @@
 
 import org.apache.axis.AxisFault;
 import org.apache.axis.Constants;
+import org.apache.axis.AxisProperties;
 import org.apache.axis.components.logger.LogFactory;
 import org.apache.axis.description.FieldDesc;
 import org.apache.axis.description.TypeDesc;
@@ -62,11 +63,23 @@
     private static final Object[] ZERO_ARGS =
         new Object [] { "0" };
 
+    public static final String PROP_ERROR_ON_NULL_VALUE = 
+        "BeanSerializer.errorOnNullWithNonNillableElement";
+
     QName xmlType;
     Class javaType;
 
+    protected static boolean errorOnNullWithNonNillableElement = true;
+
     protected BeanPropertyDescriptor[] propertyDescriptor = null;
     protected TypeDesc typeDesc = null;
+    
+    static {
+        errorOnNullWithNonNillableElement = 
+            JavaUtils.isTrue(
+                       AxisProperties.getProperty(PROP_ERROR_ON_NULL_VALUE),
+                       true);
+    }
 
     // Construct BeanSerializer for the indicated class/qname
     public BeanSerializer(Class javaType, QName xmlType) {
@@ -211,7 +224,7 @@
                                     }
                                 }
 
-                                if (propValue == null) {
+                                if (propValue == null && errorOnNullWithNonNillableElement) {
                                     throw new IOException(
                                             Messages.getMessage(
                                                     "nullNonNillableElement",

Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/handlers/HandlerChainImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/handlers/HandlerChainImpl.java?view=diff&rev=513373&r1=513372&r2=513373
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/handlers/HandlerChainImpl.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/handlers/HandlerChainImpl.java Thu Mar  1 07:12:00 2007
@@ -31,6 +31,7 @@
 import javax.xml.soap.SOAPEnvelope;
 import javax.xml.soap.SOAPException;
 import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.Node;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
@@ -112,20 +113,24 @@
 
     public ArrayList getMessageInfo(SOAPMessage message) {
         ArrayList list = new ArrayList();
+        if(message == null || message.getSOAPPart() == null) {
+            return list;
+        }
         try {
-            if(message == null || message.getSOAPPart() == null)
-                return list;
             SOAPEnvelope env = message.getSOAPPart().getEnvelope();
             SOAPBody body = env.getBody();
             Iterator it = body.getChildElements();
             SOAPElement operation = (SOAPElement)it.next();
             list.add(operation.getElementName().toString());
             for (Iterator i = operation.getChildElements(); i.hasNext();) {
-                SOAPElement elt = (SOAPElement)i.next();
-                list.add(elt.getElementName().toString());
+                Node node = (Node)i.next();
+                if (node instanceof SOAPElement) {
+                    SOAPElement elt = (SOAPElement)node;
+                    list.add(elt.getElementName().toString());
+                }
             }
         } catch (Exception e) {
-            log.debug("Exception in getMessageInfo : ", e);
+            log.debug("Exception in getMessageInfo", e);
         }
         return list;
     }
@@ -247,4 +252,4 @@
             throw new JAXRPCException(messageText, ex);
         }
     }
-}
\ No newline at end of file
+}

Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/handlers/LogHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/handlers/LogHandler.java?view=diff&rev=513373&r1=513372&r2=513373
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/handlers/LogHandler.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/handlers/LogHandler.java Thu Mar  1 07:12:00 2007
@@ -91,8 +91,10 @@
             writer.println( "=======================================================" );
 
             //START FIX: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16646
-            if (!writeToConsole) {
-              writer.close();
+            if (writeToConsole) {
+                writer.flush();
+            } else {
+                writer.close();
             }
             //END FIX: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16646
 



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