summaryrefslogtreecommitdiffstats
path: root/branches
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-04-30 18:08:56 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-04-30 18:08:56 +0000
commit83599881bab90e7868de8327f180ad892c811533 (patch)
treed0ebeb7b213292fbfdb867b1ec3af73589693b86 /branches
parentac4c8796ff5fc42deff8cdda446447838c4f83fc (diff)
Move the Holder logic into JAXWS interface processor
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@770367 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches')
-rw-r--r--branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java50
-rw-r--r--branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java6
2 files changed, 11 insertions, 45 deletions
diff --git a/branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java b/branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java
index ee26d61c42..66b5cabb11 100644
--- a/branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java
+++ b/branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java
@@ -6,24 +6,22 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
- * under the License.
+ * under the License.
*/
package org.apache.tuscany.sca.core.databinding.wire;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.lang.reflect.Type;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
@@ -46,7 +44,7 @@ import org.osoa.sca.ServiceRuntimeException;
/**
* An interceptor to transform data across databindings on the wire
- *
+ *
* @version $Rev$ $Date$
*/
public class DataTransformationInterceptor implements Interceptor, DataExchangeSemantics {
@@ -71,17 +69,7 @@ public class DataTransformationInterceptor implements Interceptor, DataExchangeS
JavaOperation javaOp = (JavaOperation) sourceOperation;
Method sourceMethod = javaOp.getJavaMethod();
}
- // Holder pattern. In order to perform data mediation on Holder return types, it is
- // necessary to set up a data transformation on the Holder<T> class T. on return.
- DataType<DataType> returnTargetType = getFirstHolderType( sourceOperation.getInputType() );
- if ( returnTargetType != null ) {
- this.sourceOperation.setOutputType(returnTargetType);
- }
- returnTargetType = getFirstHolderType( targetOperation.getInputType() );
- if ( returnTargetType != null ) {
- this.targetOperation.setOutputType(returnTargetType);
- }
-
+
this.mediator = mediator;
this.wire = wire;
this.faultExceptionMapper = faultExceptionMapper;
@@ -283,32 +271,4 @@ public class DataTransformationInterceptor implements Interceptor, DataExchangeS
return true;
}
- /**
- * Returns return type for first Holder in input list.
- * Returns null if the inputs do not contain a Holder.
- */
- protected static DataType<DataType> getFirstHolderType( DataType<List<DataType>> inputTypes ) {
- if (inputTypes != null) {
- List<DataType> logicalType = inputTypes.getLogical();
- if (logicalType != null) {
- for (int i = 0; i < logicalType.size(); i++) {
- DataType dataType = logicalType.get(i);
- if (isHolder(dataType.getGenericType())) {
- // Fix up output from void to returned data type.
- // System.out.println("DataTransformationInterceptor.<> source input[" + i + "] is Holder, logicalType=" + dataType);
- return dataType;
- }
- }
- }
- }
- return null;
- }
-
- protected static boolean isHolder( Type type ) {
- String typeString = type.toString();
- if ( typeString.startsWith( "javax.xml.ws.Holder" ) ) {
- return true;
- }
- return false;
- }
}
diff --git a/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java b/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
index cc2a3b2d58..27cd163d13 100644
--- a/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
+++ b/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
@@ -356,6 +356,12 @@ public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor {
}
}
}
+ // FIXME: We only handle one Holder
+ // Set the output type to the parameter type
+ ParameterMode mode = parameterModes.get(i);
+ if (mode == ParameterMode.OUT || mode == ParameterMode.INOUT) {
+ operation.setOutputType(inputTypes.get(i));
+ }
}
}
}