You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2007/04/06 19:30:47 UTC

svn commit: r526232 [2/5] - in /incubator/tuscany/java/sca/modules: ./ idl/src/main/java/org/apache/tuscany/idl/util/ impl-java-xml/src/main/java/org/apache/tuscany/api/ impl-java-xml/src/main/java/org/apache/tuscany/api/annotation/ impl-java-xml/src/m...

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/HeuristicPojoProcessor.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/HeuristicPojoProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/HeuristicPojoProcessor.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/HeuristicPojoProcessor.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/HeuristicPojoProcessor.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/HeuristicPojoProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/HeuristicPojoProcessor.java Fri Apr  6 10:30:44 2007
@@ -16,13 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import static org.apache.tuscany.core.util.JavaIntrospectionHelper.getAllInterfaces;
-import static org.apache.tuscany.core.util.JavaIntrospectionHelper.getAllPublicAndProtectedFields;
-import static org.apache.tuscany.core.util.JavaIntrospectionHelper.getAllUniquePublicProtectedMethods;
-import static org.apache.tuscany.core.util.JavaIntrospectionHelper.getBaseName;
-import static org.apache.tuscany.core.util.JavaIntrospectionHelper.toPropertyName;
+import static org.apache.tuscany.implementation.java.processor.JavaIntrospectionHelper.getAllInterfaces;
+import static org.apache.tuscany.implementation.java.processor.JavaIntrospectionHelper.getAllPublicAndProtectedFields;
+import static org.apache.tuscany.implementation.java.processor.JavaIntrospectionHelper.getAllUniquePublicProtectedMethods;
+import static org.apache.tuscany.implementation.java.processor.JavaIntrospectionHelper.toPropertyName;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Constructor;
@@ -31,7 +30,6 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.Type;
-import java.net.URI;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -40,25 +38,22 @@
 import java.util.Map;
 import java.util.Set;
 
-import javax.xml.namespace.QName;
-
 import org.apache.tuscany.api.annotation.Monitor;
 import org.apache.tuscany.api.annotation.Resource;
-import org.apache.tuscany.core.idl.java.IllegalCallbackException;
-import org.apache.tuscany.core.util.JavaIntrospectionHelper;
-import org.apache.tuscany.spi.databinding.extension.SimpleTypeMapperExtension;
-import org.apache.tuscany.spi.deployer.DeploymentContext;
-import org.apache.tuscany.spi.idl.InvalidServiceContractException;
-import org.apache.tuscany.spi.implementation.java.ConstructorDefinition;
-import org.apache.tuscany.spi.implementation.java.ImplementationProcessorExtension;
-import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
-import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
-import org.apache.tuscany.spi.implementation.java.JavaMappedService;
-import org.apache.tuscany.spi.implementation.java.Parameter;
-import org.apache.tuscany.spi.implementation.java.PojoComponentType;
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
-import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.model.TypeInfo;
+import org.apache.tuscany.assembly.Contract;
+import org.apache.tuscany.assembly.Multiplicity;
+import org.apache.tuscany.idl.Interface;
+import org.apache.tuscany.idl.InvalidInterfaceException;
+import org.apache.tuscany.idl.java.JavaFactory;
+import org.apache.tuscany.idl.java.JavaInterface;
+import org.apache.tuscany.idl.java.impl.DefaultJavaFactory;
+import org.apache.tuscany.idl.util.JavaXMLMapper;
+import org.apache.tuscany.implementation.java.impl.ConstructorDefinition;
+import org.apache.tuscany.implementation.java.impl.JavaElement;
+import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
+import org.apache.tuscany.implementation.java.impl.Parameter;
+import org.apache.tuscany.implementation.java.introspection.ImplementationProcessorExtension;
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 import org.osoa.sca.annotations.Callback;
 import org.osoa.sca.annotations.Property;
 import org.osoa.sca.annotations.Reference;
@@ -78,15 +73,14 @@
  * @version $Rev$ $Date$
  */
 public class HeuristicPojoProcessor extends ImplementationProcessorExtension {
-    private SimpleTypeMapperExtension typeMapper = new SimpleTypeMapperExtension();
+    private JavaFactory javaFactory;
 
     public HeuristicPojoProcessor() {
+        this.javaFactory = new DefaultJavaFactory();
     }
 
-    public <T> void visitEnd(Class<T> clazz,
-                             PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type,
-                             DeploymentContext context) throws ProcessingException {
-        Map<String, JavaMappedService> services = type.getServices();
+    public <T> void visitEnd(Class<T> clazz, JavaImplementationDefinition type) throws ProcessingException {
+        List<org.apache.tuscany.assembly.Service> services = type.getServices();
         if (services.isEmpty()) {
             // heuristically determine the service
             // TODO finish algorithm
@@ -100,7 +94,7 @@
             }
         }
         Set<Method> methods = getAllUniquePublicProtectedMethods(clazz);
-        if (!type.getReferences().isEmpty() || !type.getProperties().isEmpty()) {
+        if (!type.getReferenceMembers().isEmpty() || !type.getPropertyMembers().isEmpty()) {
             // references and properties have been explicitly defined
             if (type.getServices().isEmpty()) {
                 calculateServiceInterface(clazz, type, methods);
@@ -115,12 +109,11 @@
         evaluateConstructor(type, clazz);
     }
 
-    private void addService(PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type,
-                            Class<?> clazz) throws ProcessingException {
+    private void addService(JavaImplementationDefinition type, Class<?> clazz) throws ProcessingException {
         try {
-            JavaMappedService service = createService(clazz);
-            type.getServices().put(service.getUri().getFragment(), service);
-        } catch (InvalidServiceContractException e) {
+            org.apache.tuscany.assembly.Service service = createService(clazz);
+            type.getServices().add(service);
+        } catch (InvalidInterfaceException e) {
             throw new ProcessingException(e);
         }
     }
@@ -138,8 +131,8 @@
     }
 
     private <T> void calcPropRefs(Set<Method> methods,
-                                  Map<String, JavaMappedService> services,
-                                  PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type,
+                                  List<org.apache.tuscany.assembly.Service> services,
+                                  JavaImplementationDefinition type,
                                   Class<T> clazz) throws ProcessingException {
         // heuristically determine the properties references
         // make a first pass through all public methods with one param
@@ -153,13 +146,15 @@
                 String name = toPropertyName(method.getName());
                 setters.add(name);
                 // avoid duplicate property or ref names
-                if (!type.getProperties().containsKey(name) && !type.getReferences().containsKey(name)) {
+                if (!type.getPropertyMembers().containsKey(name) && !type.getReferenceMembers().containsKey(name)) {
                     Class<?> param = method.getParameterTypes()[0];
                     Type genericType = method.getGenericParameterTypes()[0];
                     if (isReferenceType(param, genericType)) {
-                        type.add(createReference(name, method, param));
+                        type.getReferences().add(createReference(name, param));
+                        type.getReferenceMembers().put(name, new JavaElement(method, 0));
                     } else {
-                        type.add(createProperty(name, method, param));
+                        type.getProperties().add(createProperty(name, param));
+                        type.getPropertyMembers().put(name, new JavaElement(method, 0));
                     }
                 }
             }
@@ -173,11 +168,13 @@
             String name = toPropertyName(method.getName());
             setters.add(name);
             // avoid duplicate property or ref names
-            if (!type.getProperties().containsKey(name) && !type.getReferences().containsKey(name)) {
+            if (!type.getPropertyMembers().containsKey(name) && !type.getReferenceMembers().containsKey(name)) {
                 if (isReferenceType(param, method.getGenericParameterTypes()[0])) {
-                    type.add(createReference(name, method, param));
+                    type.getReferences().add(createReference(name, param));
+                    type.getReferenceMembers().put(name, new JavaElement(method, 0));
                 } else {
-                    type.add(createProperty(name, method, param));
+                    type.getProperties().add(createProperty(name, param));
+                    type.getPropertyMembers().put(name, new JavaElement(method, 0));
                 }
             }
         }
@@ -190,11 +187,14 @@
             if (setters.contains(field.getName())) {
                 continue;
             }
+            String name = field.getName();
             Class<?> paramType = field.getType();
             if (isReferenceType(paramType, field.getGenericType())) {
-                type.add(createReference(field.getName(), field, paramType));
+                type.getReferences().add(createReference(name, paramType));
+                type.getReferenceMembers().put(name, new JavaElement(field));
             } else {
-                type.add(createProperty(field.getName(), field, paramType));
+                type.getProperties().add(createProperty(name, paramType));
+                type.getPropertyMembers().put(name, new JavaElement(field));
             }
         }
     }
@@ -210,9 +210,7 @@
      *             cannot be unambiguously mapped to references and properties
      */
     @SuppressWarnings("unchecked")
-    private <T> void evaluateConstructor(PojoComponentType<JavaMappedService, 
-                                         JavaMappedReference, JavaMappedProperty<?>> type,
-                                         Class<T> clazz) throws ProcessingException {
+    private <T> void evaluateConstructor(JavaImplementationDefinition type, Class<T> clazz) throws ProcessingException {
         // determine constructor if one is not annotated
         ConstructorDefinition<?> definition = type.getConstructorDefinition();
         Constructor constructor;
@@ -228,14 +226,14 @@
             // no definition, heuristically determine constructor
             Constructor[] constructors = clazz.getConstructors();
             if (constructors.length == 0) {
-                throw new NoConstructorException("No public constructor for class", clazz.getName());
+                throw new NoConstructorException("No public constructor for class");
             } else if (constructors.length == 1) {
                 // Only one constructor, take it
                 constructor = constructors[0];
             } else {
                 // FIXME multiple constructors, none yet done
                 Constructor<T> selected = null;
-                int sites = type.getProperties().size() + type.getReferences().size();
+                int sites = type.getPropertyMembers().size() + type.getReferenceMembers().size();
                 for (Constructor<T> ctor : constructors) {
                     if (ctor.getParameterTypes().length == 0) {
                         selected = ctor;
@@ -262,8 +260,8 @@
         if (parameters.length == 0) {
             return;
         }
-        Map<String, JavaMappedProperty<?>> props = type.getProperties();
-        Map<String, JavaMappedReference> refs = type.getReferences();
+        Map<String, JavaElement> props = type.getPropertyMembers();
+        Map<String, JavaElement> refs = type.getReferenceMembers();
         Annotation[][] annotations = constructor.getParameterAnnotations();
         if (!explict) {
             // the constructor wasn't defined by an annotation, so check to see
@@ -290,15 +288,14 @@
             if (!(props.isEmpty() && refs.isEmpty())) {
                 calcParamNames(parameters, props, refs);
             } else {
-                heuristicParamNames(parameters, refs, props);
+                heuristicParamNames(type, parameters);
 
             }
         }
     }
 
-    private void calcParamNames(Parameter[] parameters,
-                                Map<String, JavaMappedProperty<?>> props,
-                                Map<String, JavaMappedReference> refs) throws AmbiguousConstructorException {
+    private void calcParamNames(Parameter[] parameters, Map<String, JavaElement> props, Map<String, JavaElement> refs)
+        throws AmbiguousConstructorException {
         // the constructor param types must unambiguously match defined
         // reference or property types
         for (Parameter param : parameters) {
@@ -308,18 +305,19 @@
         }
     }
 
-    private void heuristicParamNames(Parameter[] parameters,
-                                     Map<String, JavaMappedReference> refs,
-                                     Map<String, JavaMappedProperty<?>> props) throws ProcessingException {
+    private void heuristicParamNames(JavaImplementationDefinition type, Parameter[] parameters)
+        throws ProcessingException {
         // heuristically determine refs and props from the parameter types
         for (Parameter p : parameters) {
             String name = p.getType().getSimpleName().toLowerCase();
             if (isReferenceType(p.getType(), p.getGenericType())) {
-                refs.put(name, createReference(name, null, p.getType()));
+                type.getReferences().add(createReference(name, p.getType()));
                 p.setClassifer(Reference.class);
+                type.getReferenceMembers().put(name, p);
             } else {
-                props.put(name, createProperty(name, null, p.getType()));
+                type.getProperties().add(createProperty(name, p.getType()));
                 p.setClassifer(Property.class);
+                type.getPropertyMembers().put(name, p);
             }
             p.setName(name);
         }
@@ -334,17 +332,16 @@
      * Returns true if the union of the given collections of properties and
      * references have unique Java types
      */
-    private boolean calcPropRefUniqueness(Collection<JavaMappedProperty<?>> props, 
-                                          Collection<JavaMappedReference> refs) {
+    private boolean calcPropRefUniqueness(Collection<JavaElement> props, Collection<JavaElement> refs) {
 
         Class[] classes = new Class[props.size() + refs.size()];
         int i = 0;
-        for (JavaMappedProperty<?> property : props) {
-            classes[i] = property.getJavaType();
+        for (JavaElement property : props) {
+            classes[i] = property.getType();
             i++;
         }
-        for (JavaMappedReference reference : refs) {
-            classes[i] = reference.getServiceContract().getInterfaceClass();
+        for (JavaElement reference : refs) {
+            classes[i] = reference.getType();
             i++;
         }
         return areUnique(classes);
@@ -359,29 +356,28 @@
      *             be resolved to a property or reference
      */
     private boolean findReferenceOrProperty(Parameter parameter,
-                                            Map<String, JavaMappedProperty<?>> props,
-                                            Map<String, JavaMappedReference> refs) 
-        throws AmbiguousConstructorException {
+                                            Map<String, JavaElement> props,
+                                            Map<String, JavaElement> refs) throws AmbiguousConstructorException {
 
         boolean found = false;
         if (!"".equals(parameter.getName())) {
             // Match by name
-            JavaMappedProperty<?> prop = props.get(parameter.getName());
-            if (prop != null && prop.getJavaType() == parameter.getType()) {
+            JavaElement prop = props.get(parameter.getName());
+            if (prop != null && prop.getType() == parameter.getType()) {
                 parameter.setClassifer(Property.class);
                 return true;
             }
-            JavaMappedReference ref = refs.get(parameter.getName());
-            if (ref != null && ref.getServiceContract().getInterfaceClass() == parameter.getType()) {
+            JavaElement ref = refs.get(parameter.getName());
+            if (ref != null && ref.getType() == parameter.getType()) {
                 parameter.setClassifer(Reference.class);
                 return true;
             }
         }
-        for (JavaMappedProperty<?> property : props.values()) {
-            if (property.getJavaType() == parameter.getType()) {
+        for (JavaElement property : props.values()) {
+            if (property.getType() == parameter.getType()) {
                 if (found) {
                     throw new AmbiguousConstructorException("Ambiguous property or reference for constructor type",
-                                                            parameter.toString());
+                                                            (Member)parameter.getAnchor());
                 }
                 parameter.setClassifer(Property.class);
                 parameter.setName(property.getName());
@@ -390,14 +386,14 @@
                 // than one prop or ref of the same type
             }
         }
-        for (JavaMappedReference reference : refs.values()) {
-            if (reference.getServiceContract().getInterfaceClass().equals(parameter.getType())) {
+        for (JavaElement reference : refs.values()) {
+            if (reference.getType() == parameter.getType()) {
                 if (found) {
                     throw new AmbiguousConstructorException("Ambiguous property or reference for constructor type",
-                                                            parameter.toString());
+                                                            (Member)parameter.getAnchor());
                 }
                 parameter.setClassifer(Reference.class);
-                parameter.setName(reference.getUri().getFragment());
+                parameter.setName(reference.getName());
                 found = true;
                 // do not break since ambiguities must be checked, i.e. more
                 // than one prop or ref of the same type
@@ -439,11 +435,14 @@
      * Returns true if the given operation is defined in the collection of
      * service interfaces
      */
-    private boolean isInServiceInterface(Method operation, Map<String, JavaMappedService> services) {
-        for (JavaMappedService service : services.values()) {
-            Class<?> clazz = service.getServiceContract().getInterfaceClass();
-            if (isMethodMatched(clazz, operation)) {
-                return true;
+    private boolean isInServiceInterface(Method operation, List<org.apache.tuscany.assembly.Service> services) {
+        for (org.apache.tuscany.assembly.Service service : services) {
+            Interface interface1 = service.getInterface();
+            if (interface1 instanceof JavaInterface) {
+                Class<?> clazz = ((JavaInterface)interface1).getJavaClass();
+                if (isMethodMatched(clazz, operation)) {
+                    return true;
+                }
             }
         }
         return false;
@@ -477,13 +476,11 @@
      * @param member the injection site the reference maps to
      * @param paramType the property type
      */
-    private <T> JavaMappedProperty<T> createProperty(String name, Member member, Class<T> paramType) {
-        QName xmlType = null;
-        TypeInfo xmlTypeInfo = typeMapper.getXMLType(paramType);
-        if (xmlTypeInfo != null) {
-            xmlType = xmlTypeInfo.getQName();
-        }
-        return new JavaMappedProperty<T>(name, xmlType, paramType, member);
+    private org.apache.tuscany.assembly.Property createProperty(String name, Class<?> paramType) {
+        org.apache.tuscany.assembly.Property property = factory.createProperty();
+        property.setName(name);
+        property.setXSDType(JavaXMLMapper.getXMLType(paramType));
+        return property;
     }
 
     /**
@@ -496,14 +493,12 @@
      * @param type the component type
      * @param methods all methods in the class to examine
      */
-    private void calculateServiceInterface(Class<?> clazz,
-                                           PojoComponentType<JavaMappedService, 
-                                           JavaMappedReference, JavaMappedProperty<?>> type,
-                                           Set<Method> methods) throws ProcessingException {
+    private void calculateServiceInterface(Class<?> clazz, JavaImplementationDefinition type, Set<Method> methods)
+        throws ProcessingException {
         List<Method> nonPropRefMethods = new ArrayList<Method>();
-        // Map<String, JavaMappedService> services = type.getServices();
-        Map<String, JavaMappedReference> references = type.getReferences();
-        Map<String, JavaMappedProperty<?>> properties = type.getProperties();
+        // Map<String, Service> services = type.getServices();
+        Map<String, JavaElement> references = type.getReferenceMembers();
+        Map<String, JavaElement> properties = type.getPropertyMembers();
         // calculate methods that are not properties or references
         for (Method method : methods) {
             String name = toPropertyName(method.getName());
@@ -519,13 +514,13 @@
         }
         for (Class interfaze : interfaces) {
             if (analyzeInterface(interfaze, nonPropRefMethods)) {
-                JavaMappedService service;
+                org.apache.tuscany.assembly.Service service;
                 try {
                     service = createService(interfaze);
-                } catch (InvalidServiceContractException e) {
+                } catch (InvalidInterfaceException e) {
                     throw new ProcessingException(e);
                 }
-                type.getServices().put(service.getUri().getFragment(), service);
+                type.getServices().add(service);
             }
         }
     }
@@ -573,45 +568,43 @@
         return true;
     }
 
-    public JavaMappedReference createReference(String name, Member member, Class<?> paramType)
+    public org.apache.tuscany.assembly.Reference createReference(String name, Class<?> paramType)
         throws ProcessingException {
-        JavaMappedReference reference = new JavaMappedReference();
-        reference.setUri(URI.create("#" + name));
-        reference.setMember(member);
-        reference.setRequired(false);
-        ServiceContract contract;
+        org.apache.tuscany.assembly.Reference reference = factory.createReference();
+        reference.setName(name);
         try {
-            contract = interfaceProcessorRegistry.introspect(paramType);
-        } catch (InvalidServiceContractException e1) {
+            interfaceProcessorRegistry.introspect(reference, paramType);
+            reference.setMultiplicity(Multiplicity.ZERO_ONE);
+        } catch (InvalidInterfaceException e1) {
             throw new ProcessingException(e1);
         }
         try {
-            processCallback(paramType, contract);
-        } catch (IllegalCallbackException e) {
+            processCallback(paramType, reference);
+        } catch (InvalidServiceType e) {
             throw new ProcessingException(e);
         }
-        reference.setServiceContract(contract);
         return reference;
     }
 
-    public JavaMappedService createService(Class<?> interfaze) throws InvalidServiceContractException {
-        JavaMappedService service = new JavaMappedService();
-        // create a relative URI
-        service.setUri(URI.create("#" + interfaze.getSimpleName()));
-        service.setRemotable(interfaze.getAnnotation(Remotable.class) != null);
-        ServiceContract<?> contract = interfaceProcessorRegistry.introspect(interfaze);
-        service.setServiceContract(contract);
+    public org.apache.tuscany.assembly.Service createService(Class<?> interfaze) throws InvalidInterfaceException {
+        org.apache.tuscany.assembly.Service service = factory.createComponentService();
+        service.setName(interfaze.getSimpleName());
+        interfaceProcessorRegistry.introspect(service, interfaze);
+        Interface javaInterface = service.getInterface();
+        javaInterface.setRemotable(interfaze.getAnnotation(Remotable.class) != null);
+        service.setInterface(javaInterface);
         return service;
     }
 
-    public void processCallback(Class<?> interfaze, ServiceContract<?> contract) throws IllegalCallbackException {
+    public void processCallback(Class<?> interfaze, Contract contract) throws InvalidServiceType {
         Callback callback = interfaze.getAnnotation(Callback.class);
         if (callback != null && !Void.class.equals(callback.value())) {
             Class<?> callbackClass = callback.value();
-            contract.setCallbackClass(callbackClass);
-            contract.setCallbackName(getBaseName(callbackClass));
+            JavaInterface javaInterface = javaFactory.createJavaInterface();
+            javaInterface.setJavaClass(callbackClass);
+            contract.setCallbackInterface(javaInterface);
         } else if (callback != null && Void.class.equals(callback.value())) {
-            throw new IllegalCallbackException("No callback interface specified on annotation", interfaze.getName());
+            throw new InvalidServiceType("No callback interface specified on annotation", interfaze);
         }
     }
 
@@ -620,7 +613,8 @@
             for (Annotation annotation : annotations) {
                 Class<? extends Annotation> annotType = annotation.annotationType();
                 if (annotType.equals(Property.class) || annotType.equals(Reference.class)
-                    || annotType.equals(Resource.class) || annotType.equals(Monitor.class)) {
+                    || annotType.equals(Resource.class)
+                    || annotType.equals(Monitor.class)) {
                     return true;
                 }
             }

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalCallbackReferenceException.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalCallbackReferenceException.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalCallbackReferenceException.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalCallbackReferenceException.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalCallbackReferenceException.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalCallbackReferenceException.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalCallbackReferenceException.java Fri Apr  6 10:30:44 2007
@@ -16,9 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
+import java.lang.reflect.Member;
+
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 
 /**
  * Denotes an illegcal use of {@link org.osoa.sca.annotations.Callback} on a reference
@@ -31,8 +33,8 @@
     public IllegalCallbackReferenceException(String message) {
         super(message);
     }
-
-    public IllegalCallbackReferenceException(String message, String identifier) {
-        super(message, identifier);
+    
+    public IllegalCallbackReferenceException(String message, Member member) {
+        super(message, member);
     }
 }

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalContextException.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalContextException.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalContextException.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalContextException.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalContextException.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalContextException.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalContextException.java Fri Apr  6 10:30:44 2007
@@ -16,9 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
+import java.lang.reflect.Member;
+
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 
 /**
  * Denotes an illegal signature for a method decorated with {@link org.osoa.sca.annotations.Context}
@@ -32,7 +34,7 @@
         super(message);
     }
 
-    public IllegalContextException(String message, String identifier) {
-        super(message, identifier);
+    public IllegalContextException(String message, Member member) {
+        super(message, member);
     }
 }

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalDestructorException.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalDestructorException.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalDestructorException.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalDestructorException.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalDestructorException.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalDestructorException.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalDestructorException.java Fri Apr  6 10:30:44 2007
@@ -16,9 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
+import java.lang.reflect.Member;
+
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 
 /**
  * Denotes an illegal signature for a method decorated with {@link org.osoa.sca.annotations.Destroy}
@@ -31,8 +33,8 @@
     public IllegalDestructorException(String message) {
         super(message);
     }
-
-    public IllegalDestructorException(String message, String identifier) {
-        super(message, identifier);
+    
+    public IllegalDestructorException(String message, Member member) {
+        super(message, member);
     }
 }

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalInitException.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalInitException.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalInitException.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalInitException.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalInitException.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalInitException.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalInitException.java Fri Apr  6 10:30:44 2007
@@ -16,9 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
+import java.lang.reflect.Member;
+
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 
 /**
  * Denotes an illegal signature for a method decorated with {@link @org.osoa.sca.annotations.Init}
@@ -32,7 +34,7 @@
         super(message);
     }
 
-    public IllegalInitException(String message, String identifier) {
-        super(message, identifier);
+    public IllegalInitException(String message, Member member) {
+        super(message, member);
     }
 }

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalReferenceException.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalReferenceException.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalReferenceException.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalReferenceException.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalReferenceException.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalReferenceException.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalReferenceException.java Fri Apr  6 10:30:44 2007
@@ -16,9 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
+import java.lang.reflect.Member;
+
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 
 /**
  * Denotes an illegal reference definition in a component type
@@ -31,8 +33,8 @@
     public IllegalReferenceException(String message) {
         super(message);
     }
-
-    public IllegalReferenceException(String message, String identifier) {
-        super(message, identifier);
+    
+    public IllegalReferenceException(String message, Member member) {
+        super(message, member);
     }
 }

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalResourceException.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalResourceException.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalResourceException.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalResourceException.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalResourceException.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalResourceException.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalResourceException.java Fri Apr  6 10:30:44 2007
@@ -16,9 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
+import java.lang.reflect.Member;
+
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 
 /**
  * Denotes an illegal resource definition in a component type
@@ -31,8 +33,8 @@
     public IllegalResourceException(String message) {
         super(message);
     }
-
-    public IllegalResourceException(String message, String identifier) {
-        super(message, identifier);
+    
+    public IllegalResourceException(String message, Member member) {
+        super(message, member);
     }
 }

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalServiceDefinitionException.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalServiceDefinitionException.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalServiceDefinitionException.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalServiceDefinitionException.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalServiceDefinitionException.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalServiceDefinitionException.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/IllegalServiceDefinitionException.java Fri Apr  6 10:30:44 2007
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 
 /**
  * Denotes an illegal use of the {@link @org.osoa.sca.annotations.Service} annotation
@@ -32,7 +32,4 @@
         super(message);
     }
 
-    public IllegalServiceDefinitionException(String message, String identifier) {
-        super(message, identifier);
-    }
 }

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InitProcessor.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InitProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InitProcessor.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InitProcessor.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InitProcessor.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InitProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InitProcessor.java Fri Apr  6 10:30:44 2007
@@ -16,39 +16,31 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 
+import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
+import org.apache.tuscany.implementation.java.introspection.ImplementationProcessorExtension;
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 import org.osoa.sca.annotations.Init;
 
-import org.apache.tuscany.spi.deployer.DeploymentContext;
-import org.apache.tuscany.spi.implementation.java.ImplementationProcessorExtension;
-import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
-import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
-import org.apache.tuscany.spi.implementation.java.JavaMappedService;
-import org.apache.tuscany.spi.implementation.java.PojoComponentType;
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
-
 /**
- * Processes the {@link @Init} annotation on a component implementation and updates the component type with the
- * decorated initializer method
- *
+ * Processes the {@link @Init} annotation on a component implementation and
+ * updates the component type with the decorated initializer method
+ * 
  * @version $Rev$ $Date$
  */
 public class InitProcessor extends ImplementationProcessorExtension {
 
-    public void visitMethod(Method method,
-                            PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type,
-                            DeploymentContext context)
-        throws ProcessingException {
+    public void visitMethod(Method method, JavaImplementationDefinition type) throws ProcessingException {
         Init annotation = method.getAnnotation(Init.class);
         if (annotation == null) {
             return;
         }
         if (method.getParameterTypes().length != 0) {
-            throw new IllegalInitException("Initializer must not have argments", method.toString());
+            throw new IllegalInitException("Initializer must not have argments", method);
         }
         if (type.getInitMethod() != null) {
             throw new DuplicateInitException("More than one initializer found on implementaton");

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidConstructorException.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidConstructorException.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidConstructorException.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidConstructorException.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidConstructorException.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidConstructorException.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidConstructorException.java Fri Apr  6 10:30:44 2007
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 
 /**
  * Denotes an invalid constructor definition, e.g. when the number of injection names specified in {@link
@@ -31,10 +31,6 @@
 
     public InvalidConstructorException(String message) {
         super(message);
-    }
-
-    public InvalidConstructorException(String message, String identifier) {
-        super(message, identifier);
     }
 
 }

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidConversationalImplementation.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidConversationalImplementation.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidConversationalImplementation.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidConversationalImplementation.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidConversationalImplementation.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidConversationalImplementation.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidConversationalImplementation.java Fri Apr  6 10:30:44 2007
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 
 /**
  * Raised when an implementation specifies improper conversational metadata
@@ -32,15 +32,8 @@
         super(message);
     }
 
-    public InvalidConversationalImplementation(String message, String identifier) {
-        super(message, identifier);
-    }
-
     public InvalidConversationalImplementation(String message, Throwable cause) {
         super(message, cause);
     }
 
-    public InvalidConversationalImplementation(String message, String identifier, Throwable cause) {
-        super(message, identifier, cause);
-    }
 }

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidPropertyException.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidPropertyException.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidPropertyException.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidPropertyException.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidPropertyException.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidPropertyException.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidPropertyException.java Fri Apr  6 10:30:44 2007
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 
 /**
  * Denotes an invalid usage of {@link org.osoa.sca.annotations.Property}

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidReferenceException.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidReferenceException.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidReferenceException.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidReferenceException.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidReferenceException.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidReferenceException.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidReferenceException.java Fri Apr  6 10:30:44 2007
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 
 /**
  * Denotes an invalid usage of {@link org.osoa.sca.annotations.Reference}

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidResourceException.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidResourceException.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidResourceException.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidResourceException.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidResourceException.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidResourceException.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidResourceException.java Fri Apr  6 10:30:44 2007
@@ -16,9 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
+import java.lang.reflect.Member;
+
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 
 /**
  * Denotes an invalid usage of {@link @org.apache.tuscany.api.annotation.Resource}
@@ -28,7 +30,11 @@
 public class InvalidResourceException extends ProcessingException {
     private static final long serialVersionUID = 511728001735534934L;
 
-    public InvalidResourceException(String message, String identifier) {
-        super(message, identifier);
+    public InvalidResourceException(String message) {
+        super(message);
     }
+    
+    public InvalidResourceException(String message, Member member) {
+        super(message, member);
+    }    
 }

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidServiceType.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidServiceType.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidServiceType.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidServiceType.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidServiceType.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidServiceType.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/InvalidServiceType.java Fri Apr  6 10:30:44 2007
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 
 /**
  * Thrown when a service type specified by an {@link org.osoa.sca.annotations.Service} annotation is invalid, e.g. it is
@@ -28,8 +28,21 @@
  */
 public class InvalidServiceType extends ProcessingException {
     private static final long serialVersionUID = -1076466639416644386L;
+    private Class<?> serviceType;
 
-    public InvalidServiceType(String message, String identifier) {
-        super(message, identifier);
+    public InvalidServiceType(String message) {
+        super(message);
     }
+    
+    public InvalidServiceType(String message, Class<?> clazz) {
+        super(message);
+        this.serviceType = clazz;
+    }
+
+    /**
+     * @return the serviceType
+     */
+    public Class<?> getServiceType() {
+        return serviceType;
+    }    
 }

Added: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/JavaIntrospectionHelper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/JavaIntrospectionHelper.java?view=auto&rev=526232
==============================================================================
--- incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/JavaIntrospectionHelper.java (added)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/JavaIntrospectionHelper.java Fri Apr  6 10:30:44 2007
@@ -0,0 +1,460 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * 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.    
+ */
+package org.apache.tuscany.implementation.java.processor;
+
+import java.beans.Introspector;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.GenericArrayType;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
+import java.lang.reflect.WildcardType;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Implements various reflection-related operations
+ * 
+ * @version $Rev$ $Date$
+ */
+public final class JavaIntrospectionHelper {
+
+    private static final Class[] EMPTY_CLASS_ARRY = new Class[0];
+
+    /**
+     * Hide the constructor
+     */
+    private JavaIntrospectionHelper() {
+    }
+
+    /**
+     * Returns a collection of public, and protected fields declared by a class
+     * or one of its supertypes
+     */
+    public static Set<Field> getAllPublicAndProtectedFields(Class clazz) {
+        return getAllPublicAndProtectedFields(clazz, new HashSet<Field>());
+    }
+
+    /**
+     * Recursively evaluates the type hierachy to return all fields that are
+     * public or protected
+     */
+    private static Set<Field> getAllPublicAndProtectedFields(Class clazz, Set<Field> fields) {
+        if (clazz == null || clazz.isArray() || Object.class.equals(clazz)) {
+            return fields;
+        }
+        fields = getAllPublicAndProtectedFields(clazz.getSuperclass(), fields);
+        Field[] declaredFields = clazz.getDeclaredFields();
+        for (Field field : declaredFields) {
+            int modifiers = field.getModifiers();
+            if ((Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers)) && !Modifier.isStatic(modifiers)) {
+                field.setAccessible(true); // ignore Java accessibility
+                fields.add(field);
+            }
+        }
+        return fields;
+    }
+
+    /**
+     * Returns a collection of public and protected methods declared by a class
+     * or one of its supertypes. Note that overriden methods will not be
+     * returned in the collection (i.e. only the method override will be). <p/>
+     * This method can potentially be expensive as reflection information is not
+     * cached. It is assumed that this method will be used during a
+     * configuration phase.
+     */
+    public static Set<Method> getAllUniquePublicProtectedMethods(Class clazz) {
+        return getAllUniqueMethods(clazz, new HashSet<Method>());
+    }
+
+    /**
+     * Recursively evaluates the type hierarchy to return all unique methods
+     */
+    private static Set<Method> getAllUniqueMethods(Class pClass, Set<Method> methods) {
+        if (pClass == null || pClass.isArray() || Object.class.equals(pClass)) {
+            return methods;
+        }
+        // we first evaluate methods of the subclass and then move to the parent
+        Method[] declaredMethods = pClass.getDeclaredMethods();
+        for (Method declaredMethod : declaredMethods) {
+            int modifiers = declaredMethod.getModifiers();
+            if ((!Modifier.isPublic(modifiers) && !Modifier.isProtected(modifiers)) || Modifier.isStatic(modifiers)) {
+                continue;
+            }
+            if (methods.size() == 0) {
+                methods.add(declaredMethod);
+            } else {
+                List<Method> temp = new ArrayList<Method>();
+                boolean matched = false;
+                for (Method method : methods) {
+                    // only add if not already in the set from a supclass (i.e.
+                    // the
+                    // method is not overrided)
+                    if (exactMethodMatch(declaredMethod, method)) {
+                        matched = true;
+                        break;
+                    }
+                }
+                if (!matched) {
+                    // TODO ignore Java accessibility
+                    declaredMethod.setAccessible(true);
+                    temp.add(declaredMethod);
+                }
+                methods.addAll(temp);
+                temp.clear();
+            }
+        }
+        // evaluate class hierarchy - this is done last to track inherited
+        // methods
+        methods = getAllUniqueMethods(pClass.getSuperclass(), methods);
+        return methods;
+    }
+
+    /**
+     * Finds the closest matching field with the given name, that is, a field of
+     * the exact specified type or, alternately, of a supertype.
+     * 
+     * @param name the name of the field
+     * @param type the field type
+     * @param fields the collection of fields to search
+     * @return the matching field or null if not found
+     */
+    public static Field findClosestMatchingField(String name, Class type, Set<Field> fields) {
+        Field candidate = null;
+        for (Field field : fields) {
+            if (field.getName().equals(name)) {
+                if (field.getType().equals(type)) {
+                    return field; // exact match
+                } else if (field.getType().isAssignableFrom(type) 
+                    || (field.getType().isPrimitive() && primitiveAssignable(field.getType(), type))) {
+                    // We could have the situation where a field parameter is a
+                    // primitive and the demarshalled value is
+                    // an object counterpart (e.g. Integer and int)
+                    // @spec issue
+                    // either an interface or super class, so keep a reference
+                    // until
+                    // we know there are no closer types
+                    candidate = field;
+                }
+            }
+        }
+        if (candidate != null) {
+            return candidate;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Finds the closest matching method with the given name, that is, a method
+     * taking the exact parameter types or, alternately, parameter supertypes.
+     * 
+     * @param name the name of the method
+     * @param types the method parameter types
+     * @param methods the collection of methods to search
+     * @return the matching method or null if not found
+     */
+    public static Method findClosestMatchingMethod(String name, Class[] types, Set<Method> methods) {
+        if (types == null) {
+            types = EMPTY_CLASS_ARRY;
+        }
+        Method candidate = null;
+        for (Method method : methods) {
+            if (method.getName().equals(name) && method.getParameterTypes().length == types.length) {
+                Class<?>[] params = method.getParameterTypes();
+                boolean disqualify = false;
+                boolean exactMatch = true;
+                for (int i = 0; i < params.length; i++) {
+                    if (!params[i].equals(types[i]) && !params[i].isAssignableFrom(types[i])) {
+                        // no match
+                        disqualify = true;
+                        exactMatch = false;
+                        break;
+                    } else if (!params[i].equals(types[i]) && params[i].isAssignableFrom(types[i])) {
+                        // not exact match
+                        exactMatch = false;
+                    }
+                }
+                if (disqualify) {
+                    continue;
+                } else if (exactMatch) {
+                    return method;
+                } else {
+                    candidate = method;
+                }
+            }
+        }
+        if (candidate != null) {
+            return candidate;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Determines if two methods "match" - that is, they have the same method
+     * names and exact parameter types (one is not a supertype of the other)
+     */
+    public static boolean exactMethodMatch(Method method1, Method method2) {
+        if (!method1.getName().equals(method2.getName())) {
+            return false;
+        }
+        Class<?>[] types1 = method1.getParameterTypes();
+        Class<?>[] types2 = method2.getParameterTypes();
+        if (types1.length != types2.length) {
+            return false;
+        }
+        boolean matched = true;
+        for (int i = 0; i < types1.length; i++) {
+            if (types1[i] != types2[i]) {
+                matched = false;
+                break;
+            }
+        }
+        return matched;
+    }
+
+    public static <T> Constructor<T> getDefaultConstructor(Class<T> clazz) throws NoSuchMethodException {
+        return clazz.getConstructor((Class[])null);
+    }
+
+    /**
+     * Loads a class corresponding to the class name using the current context
+     * class loader.
+     * 
+     * @throws ClassNotFoundException if the class was not found on the
+     *             classpath
+     */
+    public static Class loadClass(String pName) throws ClassNotFoundException {
+        ClassLoader loader = Thread.currentThread().getContextClassLoader();
+        return Class.forName(pName, true, loader);
+    }
+
+    /**
+     * Returns the simple name of a class - i.e. the class name devoid of its
+     * package qualifier
+     * 
+     * @param implClass the implmentation class
+     */
+    public static String getBaseName(Class<?> implClass) {
+        return implClass.getSimpleName();
+    }
+
+    public static boolean isImmutable(Class clazz) {
+        return String.class == clazz || clazz.isPrimitive()
+               || Number.class.isAssignableFrom(clazz)
+               || Boolean.class.isAssignableFrom(clazz)
+               || Character.class.isAssignableFrom(clazz)
+               || Byte.class.isAssignableFrom(clazz);
+    }
+
+    /**
+     * Takes a property name and converts it to a getter method name according
+     * to JavaBean conventions. For example, property
+     * <code>foo<code> is returned as <code>getFoo</code>
+     */
+    public static String toGetter(String name) {
+        return "get" + name.toUpperCase().substring(0, 1) + name.substring(1);
+    }
+
+    /**
+     * Takes a setter or getter method name and converts it to a property name
+     * according to JavaBean conventions. For example, <code>setFoo(var)</code>
+     * is returned as property <code>foo<code>
+     */
+    public static String toPropertyName(String name) {
+        if (!name.startsWith("set")) {
+            return name;
+        }
+        return Introspector.decapitalize(name.substring(3));
+    }
+
+    public static Class<?> getErasure(Type type) {
+        if (type instanceof Class) {
+            return (Class)type;
+        } else if (type instanceof GenericArrayType) {
+            // FIXME: How to deal with the []?
+            GenericArrayType arrayType = (GenericArrayType)type;
+            return getErasure(arrayType.getGenericComponentType());
+        } else if (type instanceof ParameterizedType) {
+            ParameterizedType pType = (ParameterizedType)type;
+            return getErasure(pType.getRawType());
+        } else if (type instanceof WildcardType) {
+            WildcardType wType = (WildcardType)type;
+            Type[] types = wType.getUpperBounds();
+            return getErasure(types[0]);
+        } else if (type instanceof TypeVariable) {
+            TypeVariable var = (TypeVariable)type;
+            Type[] types = var.getBounds();
+            return getErasure(types[0]);
+        }
+        return null;
+    }
+
+    public static Class<?> getBaseType(Class<?> cls, Type genericType) {
+        if (cls.isArray()) {
+            return cls.getComponentType();
+        } else if (Collection.class.isAssignableFrom(cls)) {
+            if (genericType instanceof ParameterizedType) {
+                // Collection<BaseType>
+                ParameterizedType parameterizedType = (ParameterizedType)genericType;
+                Type baseType = parameterizedType.getActualTypeArguments()[0];
+                if (baseType instanceof GenericArrayType) {
+                    // Base is array
+                    return cls;
+                } else {
+                    return getErasure(baseType);
+                }
+            } else {
+                return cls;
+            }
+        } else {
+            return cls;
+        }
+    }
+
+    /**
+     * Takes a property name and converts it to a setter method name according
+     * to JavaBean conventions. For example, the property
+     * <code>foo<code> is returned as <code>setFoo(var)</code>
+     */
+    public static String toSetter(String name) {
+        return "set" + name.toUpperCase().substring(0, 1) + name.substring(1);
+    }
+
+    /**
+     * Compares a two types, assuming one is a primitive, to determine if the
+     * other is its object counterpart
+     */
+    private static boolean primitiveAssignable(Class memberType, Class param) {
+        if (memberType == Integer.class) {
+            return param == Integer.TYPE;
+        } else if (memberType == Double.class) {
+            return param == Double.TYPE;
+        } else if (memberType == Float.class) {
+            return param == Float.TYPE;
+        } else if (memberType == Short.class) {
+            return param == Short.TYPE;
+        } else if (memberType == Character.class) {
+            return param == Character.TYPE;
+        } else if (memberType == Boolean.class) {
+            return param == Boolean.TYPE;
+        } else if (memberType == Byte.class) {
+            return param == Byte.TYPE;
+        } else if (param == Integer.class) {
+            return memberType == Integer.TYPE;
+        } else if (param == Double.class) {
+            return memberType == Double.TYPE;
+        } else if (param == Float.class) {
+            return memberType == Float.TYPE;
+        } else if (param == Short.class) {
+            return memberType == Short.TYPE;
+        } else if (param == Character.class) {
+            return memberType == Character.TYPE;
+        } else if (param == Boolean.class) {
+            return memberType == Boolean.TYPE;
+        } else if (param == Byte.class) {
+            return memberType == Byte.TYPE;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Returns the generic types represented in the given type. Usage as
+     * follows: <code>
+     * JavaIntrospectionHelper.getGenerics(field.getGenericType());
+     * <p/>
+     * JavaIntrospectionHelper.getGenerics(m.getGenericParameterTypes()[0];); </code>
+     * 
+     * @return the generic types in order of declaration or an empty array if
+     *         the type is not genericized
+     */
+    public static List<? extends Type> getGenerics(Type genericType) {
+        List<Type> classes = new ArrayList<Type>();
+        if (genericType instanceof ParameterizedType) {
+            ParameterizedType ptype = (ParameterizedType)genericType;
+            // get the type arguments
+            Type[] targs = ptype.getActualTypeArguments();
+            for (Type targ : targs) {
+                classes.add(targ);
+            }
+        }
+        return classes;
+    }
+
+    /**
+     * Returns the generic type specified by the class at the given position as
+     * in: <p/> <code> public class Foo<Bar,Baz>{ //.. }
+     * <p/>
+     * JavaIntrospectionHelper.introspectGeneric(Foo.class,1); <code>
+     * <p/>
+     * will return Baz.
+     */
+    public static Class introspectGeneric(Class<?> clazz, int pos) {
+        assert clazz != null : "No class specified";
+        Type type = clazz.getGenericSuperclass();
+        if (type instanceof ParameterizedType) {
+            Type[] args = ((ParameterizedType)type).getActualTypeArguments();
+            if (args.length <= pos) {
+                throw new IllegalArgumentException("Invalid index value for generic class " + clazz.getName());
+            }
+            return (Class)((ParameterizedType)type).getActualTypeArguments()[pos];
+        } else {
+            Type[] interfaces = clazz.getGenericInterfaces();
+            for (Type itype : interfaces) {
+                if (!(itype instanceof ParameterizedType)) {
+                    continue;
+                }
+                ParameterizedType interfaceType = (ParameterizedType)itype;
+                return (Class)interfaceType.getActualTypeArguments()[0];
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Returns the set of interfaces implemented by the given class and its
+     * ancestors or a blank set if none
+     */
+    public static Set<Class> getAllInterfaces(Class clazz) {
+        Set<Class> implemented = new HashSet<Class>();
+        getAllInterfaces(clazz, implemented);
+        return implemented;
+    }
+
+    private static void getAllInterfaces(Class clazz, Set<Class> implemented) {
+        Class[] interfaces = clazz.getInterfaces();
+        for (Class interfaze : interfaces) {
+            implemented.add(interfaze);
+        }
+        Class<?> superClass = clazz.getSuperclass();
+        // Object has no superclass so check for null
+        if (superClass != null && !superClass.equals(Object.class)) {
+            getAllInterfaces(superClass, implemented);
+        }
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/JavaIntrospectionHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/JavaIntrospectionHelper.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/NoConstructorException.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/NoConstructorException.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/NoConstructorException.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/NoConstructorException.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/NoConstructorException.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/NoConstructorException.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/NoConstructorException.java Fri Apr  6 10:30:44 2007
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
+import org.apache.tuscany.implementation.java.introspection.ProcessingException;
 
 /**
  * Thrown when a suitable constructor for a component implementation cannot be found
@@ -27,11 +27,11 @@
  */
 public class NoConstructorException extends ProcessingException {
     private static final long serialVersionUID = 3086706387280694424L;
-
+    
     public NoConstructorException() {
     }
-
-    public NoConstructorException(String message, String identifier) {
-        super(message, identifier);
+    
+    public NoConstructorException(String message) {
+       super(message);
     }
 }

Copied: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/PropertyProcessor.java (from r525324, incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/PropertyProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/PropertyProcessor.java?view=diff&rev=526232&p1=incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/PropertyProcessor.java&r1=525324&p2=incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/PropertyProcessor.java&r2=526232
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/PropertyProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/processor/PropertyProcessor.java Fri Apr  6 10:30:44 2007
@@ -16,22 +16,17 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package org.apache.tuscany.core.implementation.processor;
+package org.apache.tuscany.implementation.java.processor;
 
-import org.apache.tuscany.spi.databinding.extension.SimpleTypeMapperExtension;
-import org.apache.tuscany.spi.deployer.DeploymentContext;
-import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
-import org.apache.tuscany.spi.model.TypeInfo;
 import org.osoa.sca.annotations.Property;
 
 /**
- * Processes an {@link @Property} annotation, updating the component type with corresponding {@link JavaMappedProperty}
- *
+ * Processes an {@link @Property} annotation, updating the component type with
+ * corresponding {@link JavaMappedProperty}
+ * 
  * @version $Rev$ $Date$
  */
 public class PropertyProcessor extends AbstractPropertyProcessor<Property> {
-    private SimpleTypeMapperExtension typeMapper = new SimpleTypeMapperExtension();
-
     public PropertyProcessor() {
         super(Property.class);
     }
@@ -40,14 +35,8 @@
         return annotation.name();
     }
 
-    protected <T> void initProperty(JavaMappedProperty<T> property,
-                                    Property annotation,
-                                    DeploymentContext context) {
-        property.setRequired(annotation.required());
-        TypeInfo type = typeMapper.getXMLType(property.getJavaType());
-        if (type != null) {
-            property.setXmlType(type.getQName());
-        }
+    protected void initProperty(org.apache.tuscany.assembly.Property property, Property annotation) {
+        property.setMustSupply(annotation.required());
     }
 
 }



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