tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r1213702 [2/2] - in /tuscany/sca-java-2.x/trunk/modules: assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ assembly/src/main/java/org/apache/tuscany/sca/interfacedef/ assembly/src/main/java/org/apache/tuscany/sca/interfacedef/...
Date Tue, 13 Dec 2011 14:12:40 GMT
Modified: tuscany/sca-java-2.x/trunk/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java
Tue Dec 13 14:12:38 2011
@@ -46,9 +46,12 @@ public class JAXBWrapperHandler implemen
     private JAXBWrapperHelper helper = new JAXBWrapperHelper();
 
     public Object create(Operation operation, boolean input) {
-        WrapperInfo wrapperInfo = operation.getWrapper();
-        ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
-        final Class<?> wrapperClass = input ? wrapperInfo.getInputWrapperClass() :
wrapperInfo.getOutputWrapperClass();
+        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
+        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
+        
+        ElementInfo element = input ? inputWrapperInfo.getWrapperElement() : outputWrapperInfo.getWrapperElement();
+        final Class<?> wrapperClass = input ? inputWrapperInfo.getWrapperClass() :
outputWrapperInfo.getWrapperClass();
+        
         try {
             if (wrapperClass == null) {
                 return null;
@@ -64,8 +67,12 @@ public class JAXBWrapperHandler implemen
     }
 
     public void setChildren(Object wrapper, Object[] childObjects, Operation operation, boolean
input) {
+        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
+        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
+        
         List<ElementInfo> childElements =
-            input ? operation.getWrapper().getInputChildElements() : operation.getWrapper().getOutputChildElements();
+            input ? inputWrapperInfo.getChildElements() : outputWrapperInfo.getChildElements();
+            
         List<String> childNames = new ArrayList<String>();
         Map<String, Object> values = new HashMap<String, Object>();
         for (int i = 0; i < childElements.size(); i++) {
@@ -121,8 +128,11 @@ public class JAXBWrapperHandler implemen
      * @see org.apache.tuscany.sca.databinding.WrapperHandler#getChildren(java.lang.Object,
Operation, boolean)
      */
     public List getChildren(Object wrapper, Operation operation, boolean input) {
-        List<ElementInfo> childElements = input? operation.getWrapper().getInputChildElements():
-            operation.getWrapper().getOutputChildElements();
+        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
+        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
+        
+        List<ElementInfo> childElements = input? inputWrapperInfo.getChildElements():
+            outputWrapperInfo.getChildElements();
 
         List<String> childNames = new ArrayList<String>();
         for (ElementInfo e : childElements) {
@@ -135,8 +145,10 @@ public class JAXBWrapperHandler implemen
      * @see org.apache.tuscany.sca.databinding.WrapperHandler#getWrapperType(Operation, boolean)
      */
     public DataType getWrapperType(Operation operation, boolean input) {
-        WrapperInfo wrapper = operation.getWrapper();
-        DataType dt = input ? wrapper.getInputWrapperType() : wrapper.getOutputWrapperType();
+        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
+        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
+        
+        DataType dt = input ? inputWrapperInfo.getWrapperType() : outputWrapperInfo.getWrapperType();
         return dt;
     }
 
@@ -144,8 +156,12 @@ public class JAXBWrapperHandler implemen
      * @see org.apache.tuscany.sca.databinding.WrapperHandler#isInstance(java.lang.Object,
Operation, boolean)
      */
     public boolean isInstance(Object wrapper, Operation operation, boolean input) {
+        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
+        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
+        
         Class<?> wrapperClass =
-            input ? operation.getWrapper().getInputWrapperClass() : operation.getWrapper().getOutputWrapperClass();
+            input ? inputWrapperInfo.getWrapperClass() : outputWrapperInfo.getWrapperClass();
+            
         return wrapperClass == null ? false : wrapperClass.isInstance(wrapper);
     }
 }

Modified: tuscany/sca-java-2.x/trunk/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandlerTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandlerTestCase.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandlerTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandlerTestCase.java
Tue Dec 13 14:12:38 2011
@@ -58,10 +58,10 @@ public class JAXBWrapperHandlerTestCase 
     public void testCreate() {
         ElementInfo element = new ElementInfo(ELEMENT, null);
         Operation op = new OperationImpl();
-        WrapperInfo wrapperInfo = new WrapperInfo(JAXBDataBinding.NAME, element, null, null,
null);
-        wrapperInfo.setInputWrapperType(new DataTypeImpl<XMLType>(JAXBDataBinding.NAME,
StockQuoteOffer.class,
-                                                                  XMLType.UNKNOWN));
-        op.setWrapper(wrapperInfo);
+        WrapperInfo wrapperInfo = new WrapperInfo(JAXBDataBinding.NAME, element, null);
+        wrapperInfo.setWrapperType(new DataTypeImpl<XMLType>(JAXBDataBinding.NAME,
StockQuoteOffer.class,
+                                                             XMLType.UNKNOWN));
+        op.setInputWrapper(wrapperInfo);
         Object offer = handler.create(op, true);
         Assert.assertTrue(offer instanceof StockQuoteOffer);
     }
@@ -79,9 +79,9 @@ public class JAXBWrapperHandlerTestCase 
         wrapper.setInput("IBM");
         List<ElementInfo> elements = new ArrayList<ElementInfo>();
         elements.add(new ElementInfo(INPUT, null));
-        WrapperInfo wrapperInfo = new WrapperInfo(JAXBDataBinding.NAME, null, null, elements,
null);
+        WrapperInfo wrapperInfo = new WrapperInfo(JAXBDataBinding.NAME, null, elements);
         Operation op = new OperationImpl();
-        op.setWrapper(wrapperInfo);
+        op.setInputWrapper(wrapperInfo);
         List children = handler.getChildren(wrapper, op, true);
         assertNotNull(children);
         assertEquals(1, children.size());

Modified: tuscany/sca-java-2.x/trunk/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOTypeHelper.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOTypeHelper.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOTypeHelper.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOTypeHelper.java
Tue Dec 13 14:12:38 2011
@@ -202,14 +202,16 @@ public class SDOTypeHelper implements XM
     private static List<DataType> getDataTypes(Interface intf) {
         List<DataType> dataTypes = new ArrayList<DataType>();
         for (Operation op : intf.getOperations()) {
-            WrapperInfo wrapperInfo = op.getWrapper();
             
-            if (wrapperInfo != null ) {
-                DataType dt1 = wrapperInfo.getInputWrapperType();
+            WrapperInfo inputWrapperInfo = op.getInputWrapper();
+            WrapperInfo outputWrapperInfo = op.getOutputWrapper();
+            
+            if ((inputWrapperInfo != null) && (outputWrapperInfo != null)) {
+                DataType dt1 = inputWrapperInfo.getWrapperType();
                 if (dt1 != null) {
                     dataTypes.add(dt1);
                 }
-                DataType dt2 = wrapperInfo.getOutputWrapperType();
+                DataType dt2 = outputWrapperInfo.getWrapperType();
                 if (dt2 != null) {
                     dataTypes.add(dt2);
                 }

Modified: tuscany/sca-java-2.x/trunk/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java
Tue Dec 13 14:12:38 2011
@@ -51,11 +51,11 @@ import commonj.sdo.helper.XSDHelper;
 public class SDOWrapperHandler implements WrapperHandler<Object> {
 
     public Object create(Operation operation, boolean input) {
-        WrapperInfo wrapperInfo = operation.getWrapper();
-        
+        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
+        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
 
-        ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : 
-            wrapperInfo.getOutputWrapperElement();
+        ElementInfo element = input ? inputWrapperInfo.getWrapperElement() : 
+            outputWrapperInfo.getWrapperElement();
         
         HelperContext helperContext = SDOContextHelper.getHelperContext(operation);
         Type sdoType = getSDOType(helperContext, element);
@@ -67,11 +67,11 @@ public class SDOWrapperHandler implement
     }
 
     public void setChildren(Object wrapper, Object[] childObjects, Operation operation, boolean
input) {
-        WrapperInfo wrapperInfo = operation.getWrapper();
-       
+        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
+        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
         
-        List<ElementInfo> childElements = input? wrapperInfo.getInputChildElements():
-            wrapperInfo.getOutputChildElements();
+        List<ElementInfo> childElements = input? inputWrapperInfo.getChildElements():
+            outputWrapperInfo.getChildElements();
 
         for (int i = 0; i < childElements.size(); i++) {
             setChild(wrapper, i, childElements.get(i), childObjects[i]);
@@ -129,11 +129,11 @@ public class SDOWrapperHandler implement
      * @see org.apache.tuscany.sca.databinding.WrapperHandler#getWrapperType(Operation, boolean)
      */
     public DataType getWrapperType(Operation operation, boolean input) {
-        WrapperInfo wrapperInfo = operation.getWrapper();
-       
+        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
+        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
 
-        ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : 
-            wrapperInfo.getOutputWrapperElement();
+        ElementInfo element = input ? inputWrapperInfo.getWrapperElement() : 
+            outputWrapperInfo.getWrapperElement();
         
         HelperContext helperContext = SDOContextHelper.getHelperContext(operation);
         Type sdoType = getSDOType(helperContext, element);
@@ -174,11 +174,11 @@ public class SDOWrapperHandler implement
      * @see org.apache.tuscany.sca.databinding.WrapperHandler#isInstance(java.lang.Object,
Operation, boolean)
      */
     public boolean isInstance(Object wrapper, Operation operation, boolean input) {
-        WrapperInfo wrapperInfo = operation.getWrapper();
-        
+        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
+        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
 
-        ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : 
-            wrapperInfo.getOutputWrapperElement();
+        ElementInfo element = input ? inputWrapperInfo.getWrapperElement() : 
+            outputWrapperInfo.getWrapperElement();
         
         //        List<ElementInfo> childElements =
         //            input ? wrapperInfo.getInputChildElements() : wrapperInfo.getOutputChildElements();

Modified: tuscany/sca-java-2.x/trunk/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java
Tue Dec 13 14:12:38 2011
@@ -76,8 +76,8 @@ public class SDOWrapperHandlerTestCase e
         xsdHelper.define(getClass().getResourceAsStream("/wrapper.xsd"), null);
         ElementInfo element = new ElementInfo(new QName("http://www.example.com/wrapper",
"op"), null);
         Operation op = new OperationImpl();
-        WrapperInfo wrapperInfo = new WrapperInfo(SDODataBinding.NAME, element, null, null,
null);
-        op.setWrapper(wrapperInfo);
+        WrapperInfo wrapperInfo = new WrapperInfo(SDODataBinding.NAME, element, null);
+        op.setInputWrapper(wrapperInfo);
         DataObject wrapper = (DataObject) handler.create(op, true);
         assertNotNull(wrapper);
     }

Modified: tuscany/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/DataTypeHelper.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/DataTypeHelper.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/DataTypeHelper.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/DataTypeHelper.java
Tue Dec 13 14:12:38 2011
@@ -132,13 +132,15 @@ public final class DataTypeHelper {
     }
 
     private static void getDataTypes(List<DataType> dataTypes, Operation op, boolean
useWrapper) {
-        WrapperInfo wrapper = op.getWrapper();
-        if (useWrapper && wrapper != null) {
-            DataType dt1 = wrapper.getInputWrapperType();
+        WrapperInfo inputWrapper = op.getInputWrapper();
+        WrapperInfo outputWrapper = op.getOutputWrapper();
+        
+        if (useWrapper && (inputWrapper != null) && (outputWrapper != null))
{
+            DataType dt1 = inputWrapper.getWrapperType();
             if (dt1 != null) {
                 dataTypes.add(dt1);
             }
-            DataType dt2 = wrapper.getOutputWrapperType();
+            DataType dt2 = outputWrapper.getWrapperType();
             if (dt2 != null) {
                 dataTypes.add(dt2);
             }

Modified: tuscany/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/OperationDataBindingHelper.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/OperationDataBindingHelper.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/OperationDataBindingHelper.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/OperationDataBindingHelper.java
Tue Dec 13 14:12:38 2011
@@ -55,10 +55,14 @@ public class OperationDataBindingHelper 
             return false;
         }
 
-        if (source.isWrapperStyle() != target.isWrapperStyle()) {
+        if (source.isInputWrapperStyle() != target.isInputWrapperStyle()) {
             return true;
         }
 
+        if (source.isOutputWrapperStyle() != target.isOutputWrapperStyle()) {
+            return true;
+        }
+        
         // Check output type
         List<DataType> sourceOutputType = source.getOutputType().getLogical();
         List<DataType> targetOutputType = target.getOutputType().getLogical();

Modified: tuscany/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandler.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandler.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandler.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandler.java
Tue Dec 13 14:12:38 2011
@@ -47,10 +47,11 @@ public class DOMWrapperHandler implement
     }
 
     public Node create(Operation operation, boolean input) {
+        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
+        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
+        
+        ElementInfo element = input ? inputWrapperInfo.getWrapperElement() : outputWrapperInfo.getWrapperElement();
 
-        WrapperInfo wrapperInfo = operation.getWrapper();
-        ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
-        // Class<?> wrapperClass = input ? wrapperInfo.getInputWrapperClass() : wrapperInfo.getOutputWrapperClass();
         Document document = domHelper.newDocument();
         QName name = element.getQName();
         return DOMHelper.createElement(document, name);
@@ -59,8 +60,11 @@ public class DOMWrapperHandler implement
     public void setChildren(Node wrapper,
                             Object[] childObjects,
                             Operation operation, boolean input) {
-        List<ElementInfo> childElements = input? operation.getWrapper().getInputChildElements():
-            operation.getWrapper().getOutputChildElements();
+        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
+        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
+           
+        List<ElementInfo> childElements = input? inputWrapperInfo.getChildElements():
+            outputWrapperInfo.getChildElements();
         for (int i = 0; i < childElements.size(); i++) {
             setChild(wrapper, i, childElements.get(i), childObjects[i]);
         }
@@ -76,8 +80,13 @@ public class DOMWrapperHandler implement
 
     public List getChildren(Node wrapper, Operation operation, boolean input) {
         assert wrapper != null;
-        List<ElementInfo> childElements = input? operation.getWrapper().getInputChildElements():
-            operation.getWrapper().getOutputChildElements();
+        
+        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
+        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
+        
+        List<ElementInfo> childElements = input? inputWrapperInfo.getChildElements():
+            outputWrapperInfo.getChildElements();
+        
         if (wrapper.getNodeType() == Node.DOCUMENT_NODE) {
             wrapper = ((Document)wrapper).getDocumentElement();
         }
@@ -96,8 +105,10 @@ public class DOMWrapperHandler implement
      * @see org.apache.tuscany.sca.databinding.WrapperHandler#getWrapperType(Operation, boolean)
      */
     public DataType getWrapperType(Operation operation, boolean input) {
-        WrapperInfo wrapper = operation.getWrapper();
-        ElementInfo element = input? wrapper.getInputWrapperElement(): wrapper.getOutputWrapperElement();
+        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
+        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
+        
+        ElementInfo element = input? inputWrapperInfo.getWrapperElement(): outputWrapperInfo.getWrapperElement();
         DataType<XMLType> wrapperType =
             new DataTypeImpl<XMLType>(DOMDataBinding.NAME, Node.class, new XMLType(element));
         return wrapperType;
@@ -106,10 +117,12 @@ public class DOMWrapperHandler implement
     public boolean isInstance(Object wrapperObj,
                               Operation operation,
                               boolean input) {
-        WrapperInfo wrapperInfo = operation.getWrapper();
-        ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
-        List<ElementInfo> childElements =
-            input ? wrapperInfo.getInputChildElements() : wrapperInfo.getOutputChildElements();
+        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
+        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
+        
+        ElementInfo element = input ? inputWrapperInfo.getWrapperElement() : outputWrapperInfo.getWrapperElement();
+        List<ElementInfo> childElements = input ? inputWrapperInfo.getChildElements()
: outputWrapperInfo.getChildElements();
+        
         Node wrapper = (Node)wrapperObj;
         if (wrapper.getNodeType() == Node.DOCUMENT_NODE) {
             wrapper = ((Document)wrapper).getDocumentElement();

Modified: tuscany/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandlerTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandlerTestCase.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandlerTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandlerTestCase.java
Tue Dec 13 14:12:38 2011
@@ -102,9 +102,9 @@ public class DOMWrapperHandlerTestCase {
         elements.get(1).setOmissible(true);
         elements.get(1).setNillable(false);
 
-        WrapperInfo wrapperInfo = new WrapperInfo(DOMDataBinding.NAME, null, null, elements,
null);
+        WrapperInfo wrapperInfo = new WrapperInfo(DOMDataBinding.NAME, null, elements);
         this.op = new OperationImpl();
-        op.setWrapper(wrapperInfo);   
+        op.setInputWrapper(wrapperInfo);   
     }
     
     @Test

Modified: tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java
Tue Dec 13 14:12:38 2011
@@ -118,9 +118,9 @@ public class JAXWSAsyncInterfaceProcesso
                     asyncActualReturnTypeClass = (Class<?>)asyncReturnType.getActualTypeArguments()[0];
                 }
 
-                if (operation.getWrapper() != null) {
+                if (operation.getOutputWrapper() != null) {
                     // The return type could be the wrapper type per JAX-WS spec 
-                    Class<?> wrapperClass = operation.getWrapper().getOutputWrapperClass();
+                    Class<?> wrapperClass = operation.getOutputWrapper().getWrapperClass();
                     if (wrapperClass == asyncActualReturnTypeClass) {
                         return true;
                     }
@@ -182,9 +182,9 @@ public class JAXWSAsyncInterfaceProcesso
                 asyncActualLastParameterTypeClass = (Class<?>)asyncLastParameterType.getActualTypeArguments()[0];
             }
 
-            if (operation.getWrapper() != null) {
+            if (operation.getOutputWrapper() != null) {
                 // The return type could be the wrapper type per JAX-WS spec 
-                Class<?> wrapperClass = operation.getWrapper().getOutputWrapperClass();
+                Class<?> wrapperClass = operation.getOutputWrapper().getWrapperClass();
                 if (wrapperClass == asyncActualLastParameterTypeClass) {
                     return true;
                 }

Modified: tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
Tue Dec 13 14:12:38 2011
@@ -142,7 +142,8 @@ public class JAXWSJavaInterfaceProcessor
                 if(bare) {
                     // For BARE parameter style, the data won't be unwrapped
                     // The wrapper should be null
-                    operation.setWrapperStyle(false);
+                    operation.setInputWrapperStyle(false);
+                    operation.setOutputWrapperStyle(false);
                 }
                 documentStyle = methodSOAPBinding.style() == Style.DOCUMENT;
             }
@@ -338,14 +339,14 @@ public class JAXWSJavaInterfaceProcessor
                 }                                  
                     
                 String db = inputWrapperDT != null ? inputWrapperDT.getDataBinding() : JAXB_DATABINDING;
-                WrapperInfo wrapperInfo =
-                    new WrapperInfo(db, new ElementInfo(inputWrapper, null), new ElementInfo(outputWrapper,
null),
-                                    inputElements, outputElements);
+                WrapperInfo inputWrapperInfo = new WrapperInfo(db, new ElementInfo(inputWrapper,
null), inputElements);
+                WrapperInfo outputWrapperInfo = new WrapperInfo(db, new ElementInfo(outputWrapper,
null), outputElements);                  
 
-                wrapperInfo.setInputWrapperType(inputWrapperDT);
-                wrapperInfo.setOutputWrapperType(outputWrapperDT);
+                inputWrapperInfo.setWrapperType(inputWrapperDT);
+                outputWrapperInfo.setWrapperType(outputWrapperDT);
 
-                operation.setWrapper(wrapperInfo);
+                operation.setInputWrapper(inputWrapperInfo);
+                operation.setOutputWrapper(outputWrapperInfo);
             }
             
             // In both bare and wrapped cases, remove OUT-only parameters from input DataType.

Modified: tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java
Tue Dec 13 14:12:38 2011
@@ -61,9 +61,9 @@ public class JAXWSJavaInterfaceProcessor
 
         // interfaceProcessor.visitInterface(contract);
         Operation op = contract.getOperations().get(0);
-        Assert.assertTrue(!op.isWrapperStyle());
-        Assert.assertEquals(new QName("http://www.example.com/stock", "stockQuoteOffer"),
op.getWrapper().getInputWrapperElement().getQName());
-        Assert.assertEquals(new QName("http://www.example.com/stock", "stockQuoteOfferResponse"),
op.getWrapper().getOutputWrapperElement().getQName());
+        Assert.assertTrue(!op.isInputWrapperStyle());
+        Assert.assertEquals(new QName("http://www.example.com/stock", "stockQuoteOffer"),
op.getInputWrapper().getWrapperElement().getQName());
+        Assert.assertEquals(new QName("http://www.example.com/stock", "stockQuoteOfferResponse"),
op.getOutputWrapper().getWrapperElement().getQName());
     }
 
     /**
@@ -92,14 +92,14 @@ public class JAXWSJavaInterfaceProcessor
             op = op2;
         }
 
-        assertTrue(!op.isWrapperStyle() && op.getWrapper() == null);
+        assertTrue(!op.isInputWrapperStyle() && op.getInputWrapper() == null);
 
         if ("M2".equals(op2.getName())) {
             op = op2;
         } else {
             op = op1;
         }
-        assertTrue(!op.isWrapperStyle() && op.getWrapper() != null);
+        assertTrue(!op.isInputWrapperStyle() && op.getInputWrapper() != null);
 
     }
 

Modified: tuscany/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java
Tue Dec 13 14:12:38 2011
@@ -210,8 +210,10 @@ public class JavaInterfaceImpl extends I
         	
             syncOperation.setName(opName);
             syncOperation.setAsyncServer(true);
-            syncOperation.setWrapper(operation.getWrapper());
-            syncOperation.setWrapperStyle(operation.isWrapperStyle());
+            syncOperation.setInputWrapper(operation.getInputWrapper());
+            syncOperation.setOutputWrapper(operation.getOutputWrapper());
+            syncOperation.setInputWrapperStyle(operation.isInputWrapperStyle());
+            syncOperation.setOutputWrapperStyle(operation.isOutputWrapperStyle());
             syncOperation.setHasArrayWrappedOutput(operation.hasArrayWrappedOutput());
             syncOperation.setNotSubjectToWrapping(operation.isNotSubjectToWrapping());
 //            syncOperation.setInputType(inputType);

Modified: tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java
Tue Dec 13 14:12:38 2011
@@ -219,10 +219,12 @@ public class WSDLOperationIntrospectorIm
             }
             operationModel.setOutputType(getOutputType());
 
-            operationModel.setWrapperStyle(isWrapperStyle());
+            operationModel.setInputWrapperStyle(isWrapperStyle());
+            operationModel.setOutputWrapperStyle(isWrapperStyle());
+            
             if (isWrapperStyle()) {
-                WrapperInfo wrapperInfo = getWrapper().getWrapperInfo();
-                operationModel.setWrapper(wrapperInfo);
+                operationModel.setInputWrapper(getWrapper().getInputWrapperInfo());
+                operationModel.setOutputWrapper(getWrapper().getOutputWrapperInfo());   
            
             }
         }
         return operationModel;
@@ -347,11 +349,8 @@ public class WSDLOperationIntrospectorIm
 
         private List<XmlSchemaElement> outputElements;
 
-        //        private DataType<List<DataType<XMLType>>> unwrappedInputType;
-        //
-        //        private DataType<XMLType> unwrappedOutputType;
-
-        private transient WrapperInfo wrapperInfo;
+        private transient WrapperInfo inputWrapperInfo;
+        private transient WrapperInfo outputWrapperInfo;
 
         private List<XmlSchemaElement> getChildElements(XmlSchemaElement element) throws
InvalidWSDLException {
             if (element == null) {
@@ -519,61 +518,34 @@ public class WSDLOperationIntrospectorIm
             return outputWrapperElement;
         }
 
-        /*
-        public DataType<List<DataType<XMLType>>> getUnwrappedInputType()
throws InvalidWSDLException {
-            if (unwrappedInputType == null) {
-                List<DataType<XMLType>> childTypes = new ArrayList<DataType<XMLType>>();
-                for (XmlSchemaElement element : getInputChildElements()) {
-                    DataType<XMLType> type =
-                        new DataType<XMLType>(dataBinding, Object.class, new XMLType(getElementInfo(element)));
-                    // type.setMetadata(ElementInfo.class.getName(), getElementInfo(element));
-                    childTypes.add(type);
-                }
-                unwrappedInputType =
-                    new DataType<List<DataType<XMLType>>>("idl:unwrapped.input",
Object[].class, childTypes);
-            }
-            return unwrappedInputType;
-        }
-
-        public DataType<XMLType> getUnwrappedOutputType() throws InvalidServiceContractException
{
-            if (unwrappedOutputType == null) {
-                List<XmlSchemaElement> elements = getOutputChildElements();
-                if (elements != null && elements.size() > 0) {
-                    if (elements.size() > 1) {
-                        // We don't support output with multiple parts
-                        throw new NotSupportedWSDLException("Multi-part output is not supported");
-                    }
-                    XmlSchemaElement element = elements.get(0);
-                    unwrappedOutputType =
-                        new DataType<XMLType>(dataBinding, Object.class, new XMLType(getElementInfo(element)));
-                    // unwrappedOutputType.setMetadata(ElementInfo.class.getName(), getElementInfo(element));
-                }
-            }
-            return unwrappedOutputType;
-        }
-        */
-
-        public WrapperInfo getWrapperInfo() throws InvalidWSDLException {
-            if (wrapperInfo == null) {
+        public WrapperInfo getInputWrapperInfo() throws InvalidWSDLException {
+            if (inputWrapperInfo == null) {
                 ElementInfo in = getElementInfo(getInputWrapperElement());
-                ElementInfo out = getElementInfo(getOutputWrapperElement());
                 List<ElementInfo> inChildren = new ArrayList<ElementInfo>();
                 if (in != null) {
                     for (XmlSchemaElement e : getInputChildElements()) {
                         inChildren.add(getElementInfo(e));
                     }
                 }
+                inputWrapperInfo = new WrapperInfo(dataBinding, in, inChildren);
+            }
+            return inputWrapperInfo;
+        }
+    
+        public WrapperInfo getOutputWrapperInfo() throws InvalidWSDLException {
+            if (outputWrapperInfo == null) {
+                ElementInfo out = getElementInfo(getOutputWrapperElement());
                 List<ElementInfo> outChildren = new ArrayList<ElementInfo>();
                 if (out != null) {
                     for (XmlSchemaElement e : getOutputChildElements()) {
                         outChildren.add(getElementInfo(e));
                     }
                 }
-                wrapperInfo = new WrapperInfo(dataBinding, in, out, inChildren, outChildren);
+                outputWrapperInfo = new WrapperInfo(dataBinding, out, outChildren);
             }
-            return wrapperInfo;
+            return outputWrapperInfo;
         }
-    }
+    }    
 
     private static ElementInfo getElementInfo(XmlSchemaElement element) {
         if (element == null) {

Modified: tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
Tue Dec 13 14:12:38 2011
@@ -71,15 +71,15 @@ public class WSDLOperationIntrospectorTe
         DataType<XMLType> logical = outputType.getLogical().get(0);
         Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePriceResponse"),
                             logical.getLogical().getElementName());
-        Assert.assertTrue(op.isWrapperStyle());
+        Assert.assertTrue(op.isInputWrapperStyle());
 
-        DataType<List<DataType>> unwrappedInputType = op.getWrapper().getUnwrappedInputType();
+        DataType<List<DataType>> unwrappedInputType = op.getInputWrapper().getUnwrappedType();
         List<DataType> childTypes = unwrappedInputType.getLogical();
         Assert.assertEquals(1, childTypes.size());
         DataType<XMLType> childType = childTypes.get(0);
         Assert.assertEquals(new QName(null, "tickerSymbol"), childType.getLogical().getElementName());
 
-        DataType<List<DataType>> unwrappedOutputType = op.getWrapper().getUnwrappedOutputType();
+        DataType<List<DataType>> unwrappedOutputType = op.getOutputWrapper().getUnwrappedType();
         childTypes = unwrappedOutputType.getLogical();
         Assert.assertEquals(1, childTypes.size());
         childType = childTypes.get(0);
@@ -97,11 +97,11 @@ public class WSDLOperationIntrospectorTe
 
         WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver,
context.getMonitor());
         WSDLOperation op = (WSDLOperation) wi.getOperations().get(1);
-        Assert.assertFalse(op.isWrapperStyle());
+        Assert.assertFalse(op.isInputWrapperStyle());
         Assert.assertEquals(1, op.getInputType().getLogical().size());
 
         op = (WSDLOperation) wi.getOperations().get(2);
-        Assert.assertFalse(op.isWrapperStyle());
+        Assert.assertFalse(op.isInputWrapperStyle());
         Assert.assertEquals(2, op.getInputType().getLogical().size());
     }
 
@@ -118,7 +118,7 @@ public class WSDLOperationIntrospectorTe
             WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver,
context.getMonitor());
             WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
 
-            op.isWrapperStyle();
+            op.isInputWrapperStyle();
             fail("InvalidWSDLException should have been thrown");
         } catch (InvalidInterfaceException e) {
             // Expected

Modified: tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java?rev=1213702&r1=1213701&r2=1213702&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
Tue Dec 13 14:12:38 2011
@@ -52,9 +52,9 @@ public class WrapperStyleOperationTestCa
         PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
         WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver,
context.getMonitor());
         WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
-        Assert.assertTrue(op.isWrapperStyle());
-        Assert.assertEquals(1, op.getWrapper().getInputChildElements().size());
-        Assert.assertEquals(1, op.getWrapper().getOutputChildElements().size());
+        Assert.assertTrue(op.isInputWrapperStyle());
+        Assert.assertEquals(1, op.getInputWrapper().getChildElements().size());
+        Assert.assertEquals(1, op.getOutputWrapper().getChildElements().size());
     }
 
     @Test
@@ -67,11 +67,11 @@ public class WrapperStyleOperationTestCa
         PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
         WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver,
context.getMonitor());
         WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
-        Assert.assertTrue(op.isWrapperStyle());
+        Assert.assertTrue(op.isInputWrapperStyle());
         op = (WSDLOperation) wi.getOperations().get(1);
-        Assert.assertFalse(op.isWrapperStyle());
+        Assert.assertFalse(op.isInputWrapperStyle());
         op = (WSDLOperation) wi.getOperations().get(2);
-        Assert.assertFalse(op.isWrapperStyle());
+        Assert.assertFalse(op.isInputWrapperStyle());
     }
 
 
@@ -86,7 +86,7 @@ public class WrapperStyleOperationTestCa
         PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
         WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver,
context.getMonitor());
         WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
-        Assert.assertFalse(op.isWrapperStyle());
+        Assert.assertFalse(op.isInputWrapperStyle());
     }
 
 }



Mime
View raw message