axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@apache.org
Subject svn commit: r684844 - in /webservices/axis2/trunk/java/modules: adb-codegen/src/org/apache/axis2/schema/util/ adb/src/org/apache/axis2/databinding/typemapping/ kernel/src/org/apache/axis2/dataretrieval/ kernel/src/org/apache/axis2/dataretrieval/client/...
Date Mon, 11 Aug 2008 17:56:16 GMT
Author: gdaniels
Date: Mon Aug 11 10:56:09 2008
New Revision: 684844

URL: http://svn.apache.org/viewvc?rev=684844&view=rev
Log:
Check in some minor changes that had been hanging out in my sandbox.

* Fix spelling error in constant

* Support easier syntax for deploying a phase to multiple flows

* A few code cleanups / 1.5-isms


Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/util/SchemaPropertyLoader.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/DRConstants.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/client/MexClient.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java
    webservices/axis2/trunk/java/modules/samples/userguide/src/userguide/clients/EchoBlockingDualClient.java
    webservices/axis2/trunk/java/modules/transports/src/org/apache/axis2/transport/http/HTTPSender.java

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/util/SchemaPropertyLoader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/util/SchemaPropertyLoader.java?rev=684844&r1=684843&r2=684844&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/util/SchemaPropertyLoader.java
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/util/SchemaPropertyLoader.java
Mon Aug 11 10:56:09 2008
@@ -26,9 +26,7 @@
 
 import java.util.Properties;
 
-/**
- * Loads the properties  for the schema compiler.
- */
+/** Loads the properties  for the schema compiler. */
 public class SchemaPropertyLoader {
     private static String beanTemplate = null;
     private static BeanWriter beanWriterInstance = null;
@@ -42,25 +40,29 @@
             //load the properties
             Properties props = new Properties();
             String schemaPropFilename = System.getProperty(ADB_PROPERTY_FILE_KEY);
-            if (schemaPropFilename==null){
-                 // there was no system property .load the default
-                  props.load(SchemaCompiler.class.getResourceAsStream(SchemaConstants.SchemaPropertyNames.SCHEMA_COMPILER_PROPERTIES));
-            }else{
+            if (schemaPropFilename == null) {
+                // there was no system property .load the default
+                props.load(SchemaCompiler.class.getResourceAsStream(
+                        SchemaConstants.SchemaPropertyNames.SCHEMA_COMPILER_PROPERTIES));
+            } else {
                 props.load(SchemaCompiler.class.getResourceAsStream(schemaPropFilename));
             }
 
 
-            String beanWriterClassName = props.getProperty(SchemaConstants.SchemaPropertyNames.BEAN_WRITER_KEY);
+            String beanWriterClassName =
+                    props.getProperty(SchemaConstants.SchemaPropertyNames.BEAN_WRITER_KEY);
             if (beanWriterClassName != null) {
-                beanWriterInstance = (BeanWriter) Class.forName(beanWriterClassName).newInstance();
+                beanWriterInstance = (BeanWriter)Class.forName(beanWriterClassName).newInstance();
             }
 
-            String typeMapperClassName = props.getProperty(SchemaConstants.SchemaPropertyNames.BEAN_WRITER_TYPEMAP_KEY);
+            String typeMapperClassName =
+                    props.getProperty(SchemaConstants.SchemaPropertyNames.BEAN_WRITER_TYPEMAP_KEY);
             if (typeMapperClassName != null) {
-                typeMapperInstance = (TypeMap) Class.forName(typeMapperClassName).newInstance();
+                typeMapperInstance = (TypeMap)Class.forName(typeMapperClassName).newInstance();
             }
 
-            beanTemplate = props.getProperty(SchemaConstants.SchemaPropertyNames.BEAN_WRITER_TEMPLATE_KEY);
+            beanTemplate =
+                    props.getProperty(SchemaConstants.SchemaPropertyNames.BEAN_WRITER_TEMPLATE_KEY);
 
             //set the props as the property map
             propertyMap = props;
@@ -73,6 +75,7 @@
 
     /**
      * Exposes the whole property set
+     *
      * @return Returns Properties.
      */
     public static Properties getPropertyMap() {

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java?rev=684844&r1=684843&r2=684844&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
Mon Aug 11 10:56:09 2008
@@ -83,7 +83,7 @@
         } else if (name.equals(INT)) {
             return new Integer(text);
         } else if (name.equals(BOOLEAN)) {
-            return new Boolean(ConverterUtil.convertToBoolean(text));
+            return ConverterUtil.convertToBoolean(text);
         } else if (name.equals(BYTE)) {
             return new Byte(text);
         } else if (name.equals(DOUBLE)) {
@@ -95,7 +95,7 @@
         } else if (name.equals(FLOAT)) {
             return new Float(text);
         } else if (name.equals(CHAR)) {
-            return new Character(text.toCharArray()[0]);
+            return text.toCharArray()[0];
         } else if (name.equals(W_INT)) {
             return new Integer(text);
         } else if (name.equals(W_BOOLEAN)) {
@@ -111,7 +111,7 @@
         } else if (name.equals(W_FLOAT)) {
             return new Float(text);
         } else if (name.equals(W_CHAR)) {
-            return new Character(text.toCharArray()[0]);
+            return text.toCharArray()[0];
         } else if (name.equals(W_CALENDAR)) {
             return makeCalendar(text);
         } else if (name.equals(W_DATE)) {
@@ -187,13 +187,7 @@
 
     public static boolean isSimpleType(Object obj) {
         String objClassName = obj.getClass().getName();
-        if (obj instanceof Calendar) {
-            return true;
-        } else if (obj instanceof Date) {
-            return true;
-        } else {
-            return isSimpleType(objClassName);
-        }
+        return obj instanceof Calendar || obj instanceof Date || isSimpleType(objClassName);
     }
 
     public static boolean isSimpleType(Class obj) {
@@ -250,21 +244,15 @@
          * consider BigDecimal, BigInteger, Day, Duration, Month
          * MonthDay, Time, Year, YearMonth as simple type
          */
-        else if(objClassName.equals(BIG_DECIMAL)
-        		|| objClassName.equals(BIG_INTEGER)
-        		|| objClassName.equals(DAY)
-        		|| objClassName.equals(DURATION)
-        		|| objClassName.equals(MONTH)
-        		|| objClassName.equals(MONTH_DAY)
-        		|| objClassName.equals(TIME)
-        		|| objClassName.equals(YEAR)
-        		|| objClassName.equals(YEAR_MONTH))
-        {
-        	return true;
-        }
-        else {
-            return objClassName.equals(W_CHAR);
-        }
+        else return objClassName.equals(BIG_DECIMAL)
+                    || objClassName.equals(BIG_INTEGER)
+                    || objClassName.equals(DAY)
+                    || objClassName.equals(DURATION)
+                    || objClassName.equals(MONTH)
+                    || objClassName.equals(MONTH_DAY)
+                    || objClassName.equals(TIME)
+                    || objClassName.equals(YEAR)
+                    || objClassName.equals(YEAR_MONTH) || objClassName.equals(W_CHAR);
     }
 
     public static String getStringValue(Object obj) {
@@ -274,7 +262,7 @@
             if (obj instanceof Float) {
                 data = ((Float)obj).doubleValue();
             } else {
-                data = ((Double)obj).doubleValue();
+                data = (Double)obj;
             }
             if (Double.isNaN(data)) {
                 return "NaN";

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/DRConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/DRConstants.java?rev=684844&r1=684843&r2=684844&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/DRConstants.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/DRConstants.java
Mon Aug 11 10:56:09 2008
@@ -52,7 +52,11 @@
 
         String NS_PREFIX = "mex";
         String GET_METADATA = "GetMetadata";
+
+        /** @deprecated Please use DIALECT instead.  todo: delete me after 1.5 */
         String DIALET = "Dialect";
+        
+        String DIALECT = "Dialect";
         String IDENTIFIER = "Identifier";
         String METADATA = "Metadata";
         String METADATA_SECTION = "MetadataSection";

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/client/MexClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/client/MexClient.java?rev=684844&r1=684843&r2=684844&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/client/MexClient.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/client/MexClient.java
Mon Aug 11 10:56:09 2008
@@ -75,7 +75,7 @@
 
         OMElement method = fac.createOMElement(DRConstants.SPEC.GET_METADATA, omNs);
         if (dialect != null) {
-            OMElement dialectElem = fac.createOMElement(DRConstants.SPEC.DIALET, omNs);
+            OMElement dialectElem = fac.createOMElement(DRConstants.SPEC.DIALECT, omNs);
 
             dialectElem.setText(dialect);
             method.addChild(dialectElem);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java?rev=684844&r1=684843&r2=684844&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java
Mon Aug 11 10:56:09 2008
@@ -356,19 +356,27 @@
                 }
             }
             String flowName = element.getAttributeValue(new QName("flow"));
-            int flowIndex ;
-            if (TAG_FLOW_IN.equals(flowName)){
-                flowIndex = PhaseMetadata.IN_FLOW ;
-            } else if (TAG_FLOW_OUT.equals(flowName)) {
-                flowIndex = PhaseMetadata.OUT_FLOW ;
-            } else if (TAG_FLOW_OUT_FAULT.equals(flowName)) {
-                flowIndex = PhaseMetadata.FAULT_OUT_FLOW;
-            } else if (TAG_FLOW_IN_FAULT.equals(flowName)) {
-                flowIndex = PhaseMetadata.FAULT_IN_FLOW;
-            } else {
-                throw new DeploymentException(" Flow can not be null for the phase name "
+ phaseName);
+            if (flowName == null) {
+                throw new DeploymentException("Flow can not be null for the phase name "
+
+                                              phaseName);
+            }
+            String[] flows = flowName.split(",");
+            for (int i = 0; i < flows.length; i++) {
+                String flow = flows[i];
+                int flowIndex;
+                if (TAG_FLOW_IN.equals(flowName)){
+                    flowIndex = PhaseMetadata.IN_FLOW ;
+                } else if (TAG_FLOW_OUT.equals(flowName)) {
+                    flowIndex = PhaseMetadata.OUT_FLOW ;
+                } else if (TAG_FLOW_OUT_FAULT.equals(flowName)) {
+                    flowIndex = PhaseMetadata.FAULT_OUT_FLOW;
+                } else if (TAG_FLOW_IN_FAULT.equals(flowName)) {
+                    flowIndex = PhaseMetadata.FAULT_IN_FLOW;
+                } else {
+                    throw new DeploymentException("Unknown flow name '" + flow + "'");
+                }
+                axisConfig.insertPhase(d, flowIndex);
             }
-            axisConfig.insertPhase(d, flowIndex);
         }
     }
 }

Modified: webservices/axis2/trunk/java/modules/samples/userguide/src/userguide/clients/EchoBlockingDualClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/userguide/src/userguide/clients/EchoBlockingDualClient.java?rev=684844&r1=684843&r2=684844&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/userguide/src/userguide/clients/EchoBlockingDualClient.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/userguide/src/userguide/clients/EchoBlockingDualClient.java
Mon Aug 11 10:56:09 2008
@@ -35,7 +35,7 @@
  * Message Exchage Pattern IN-OUT
  */
 public class EchoBlockingDualClient {
-    private static EndpointReference targetEPR = new EndpointReference("http://127.0.0.1:8080/axis2/services/MyService");
+    private static EndpointReference targetEPR = new EndpointReference("http://127.0.0.1:8090/axis2/services/MyService");
 
     public static void main(String[] args) {
         ServiceClient sender = null;

Modified: webservices/axis2/trunk/java/modules/transports/src/org/apache/axis2/transport/http/HTTPSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/transports/src/org/apache/axis2/transport/http/HTTPSender.java?rev=684844&r1=684843&r2=684844&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/transports/src/org/apache/axis2/transport/http/HTTPSender.java
(original)
+++ webservices/axis2/trunk/java/modules/transports/src/org/apache/axis2/transport/http/HTTPSender.java
Mon Aug 11 10:56:09 2008
@@ -286,8 +286,7 @@
             }
             Object isTransportNonBlocking = msgContext.getProperty(
                     MessageContext.TRANSPORT_NON_BLOCKING);
-            if (isTransportNonBlocking != null &&
-                    ((Boolean) isTransportNonBlocking).booleanValue()) {
+            if (isTransportNonBlocking != null && (Boolean)isTransportNonBlocking)
{
                 throw new AxisFault(Messages.getMessage("transportError",
                         String.valueOf(statusCode),
                         method.getStatusText()));



Mime
View raw message