diff options
4 files changed, 26 insertions, 11 deletions
diff --git a/branches/sca-java-1.x/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingInvoker.java b/branches/sca-java-1.x/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingInvoker.java index 91072067ea..99fa3a2e73 100644 --- a/branches/sca-java-1.x/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingInvoker.java +++ b/branches/sca-java-1.x/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingInvoker.java @@ -40,6 +40,7 @@ import org.apache.commons.httpclient.methods.StringRequestEntity; import org.apache.tuscany.sca.binding.atom.collection.NotFoundException; import org.apache.tuscany.sca.data.collection.Entry; import org.apache.tuscany.sca.interfacedef.Operation; +import org.apache.tuscany.sca.invocation.DataExchangeSemantics; import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.invocation.Message; import org.osoa.sca.ServiceRuntimeException; @@ -49,7 +50,7 @@ import org.osoa.sca.ServiceRuntimeException; * * @version $Rev$ $Date$ */ -class AtomBindingInvoker implements Invoker { +class AtomBindingInvoker implements Invoker, DataExchangeSemantics { private static final Factory abderaFactory = Abdera.getNewFactory(); private static final Parser abderaParser = Abdera.getNewParser(); @@ -74,6 +75,11 @@ class AtomBindingInvoker implements Invoker { // by specific invoker subclasses throw new UnsupportedOperationException(operation.getName()); } + + public boolean allowsPassByReference() { + return true; + } + /** * Get operation invoker diff --git a/branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java b/branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java index 833017a921..d129ae6256 100644 --- a/branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java +++ b/branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java @@ -284,7 +284,7 @@ public class JAXBContextHelper { } } else if (type instanceof GenericArrayType) { GenericArrayType gType = (GenericArrayType)type; - findClasses(gType, classSet, visited); + findClasses(gType.getGenericComponentType(), classSet, visited); } else if (type instanceof WildcardType) { WildcardType wType = (WildcardType)type; for (Type t : wType.getLowerBounds()) { diff --git a/branches/sca-java-1.x/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultDataBindingExtensionPoint.java b/branches/sca-java-1.x/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultDataBindingExtensionPoint.java index b12d727ba9..e4dd96f68f 100644 --- a/branches/sca-java-1.x/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultDataBindingExtensionPoint.java +++ b/branches/sca-java-1.x/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultDataBindingExtensionPoint.java @@ -20,6 +20,8 @@ package org.apache.tuscany.sca.databinding; import java.io.IOException; import java.lang.reflect.Constructor; +import java.lang.reflect.GenericArrayType; +import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -223,12 +225,17 @@ public class DefaultDataBindingExtensionPoint implements DataBindingExtensionPoi } private boolean introspectArray(DataType dataType, Operation operation) { - Class physical = dataType.getPhysical(); + Class<?> physical = dataType.getPhysical(); if (!physical.isArray() || physical == byte[].class) { return false; } - Class componentType = physical.getComponentType(); - DataType logical = new DataTypeImpl(componentType, dataType.getLogical()); + Class<?> componentType = physical.getComponentType(); + Type genericComponentType = componentType; + + if(dataType.getGenericType() instanceof GenericArrayType) { + genericComponentType = ((GenericArrayType) dataType.getGenericType()).getGenericComponentType(); + } + DataType logical = new DataTypeImpl(dataType.getDataBinding(), componentType, genericComponentType, dataType.getLogical()); introspectType(logical, operation); dataType.setDataBinding("java:array"); dataType.setLogical(logical); diff --git a/branches/sca-java-1.x/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/MediatorImpl.java b/branches/sca-java-1.x/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/MediatorImpl.java index d94166588b..1fee253963 100644 --- a/branches/sca-java-1.x/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/MediatorImpl.java +++ b/branches/sca-java-1.x/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/MediatorImpl.java @@ -475,12 +475,14 @@ public class MediatorImpl implements Mediator { // If no databinding was specified, introspect the given arg to // determine its databinding if (dataBinding == null) { - dataType = dataBindings.introspectType(data, operation); - if (dataType != null) { - String db = dataType.getDataBinding(); - dataBinding = dataBindings.getDataBinding(db); - if (dataBinding == null && db != null) { - return data; + if(! "java:array".equals(dataType.getDataBinding())) { + dataType = dataBindings.introspectType(data, operation); + if (dataType != null) { + String db = dataType.getDataBinding(); + dataBinding = dataBindings.getDataBinding(db); + if (dataBinding == null && db != null) { + return data; + } } } if (dataBinding == null) { |