You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jm...@apache.org on 2007/02/28 21:17:25 UTC

svn commit: r512945 - in /incubator/tuscany/java/sca: extensions/spring/container/src/main/resources/META-INF/sca/ extensions/spring/integration-test/core/src/test/resources/ kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ k...

Author: jmarino
Date: Wed Feb 28 12:17:24 2007
New Revision: 512945

URL: http://svn.apache.org/viewvc?view=rev&rev=512945
Log:
remove @Autowire; extensions now use @Reference and SCA 1.0 autowire exclusively

Removed:
    incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidAutowireException.java
    incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ConstructorAutowireTestCase.java
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/annotation/Autowire.java
    incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/annotation/ConstructorAnnotationTest.java
Modified:
    incubator/tuscany/java/sca/extensions/spring/container/src/main/resources/META-INF/sca/spring.system.scdl
    incubator/tuscany/java/sca/extensions/spring/integration-test/core/src/test/resources/itest.scdl
    incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceImpl.java
    incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessor.java
    incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/ComponentLoader.java
    incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ConstructorProcessorTestCase.java
    incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicConstructorTestCase.java
    incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/ComponentLoaderValidationTestCase.java
    incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/resolver/DefaultAutowireResolverTestCase.java
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/ReferenceDefinition.java
    incubator/tuscany/java/sca/runtime/services/discovery/jxta/src/main/java/org/apache/tuscany/service/discovery/jxta/JxtaDiscoveryService.java
    incubator/tuscany/java/sca/runtime/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java

Modified: incubator/tuscany/java/sca/extensions/spring/container/src/main/resources/META-INF/sca/spring.system.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/extensions/spring/container/src/main/resources/META-INF/sca/spring.system.scdl?view=diff&rev=512945&r1=512944&r2=512945
==============================================================================
--- incubator/tuscany/java/sca/extensions/spring/container/src/main/resources/META-INF/sca/spring.system.scdl (original)
+++ incubator/tuscany/java/sca/extensions/spring/container/src/main/resources/META-INF/sca/spring.system.scdl Wed Feb 28 12:17:24 2007
@@ -22,8 +22,8 @@
 -->
 <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
            xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
-
-           name="org.apache.tuscany.launcher.SpringImplementation">
+           name="org.apache.tuscany.launcher.SpringImplementation"
+			  autowire="true">
 
    <!-- <dependency xmlns="http://tuscany.apache.org/xmlns/1.0-SNAPSHOT">
         <group>org.apache.tuscany.sca.extensions.spring</group>

Modified: incubator/tuscany/java/sca/extensions/spring/integration-test/core/src/test/resources/itest.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/extensions/spring/integration-test/core/src/test/resources/itest.scdl?view=diff&rev=512945&r1=512944&r2=512945
==============================================================================
--- incubator/tuscany/java/sca/extensions/spring/integration-test/core/src/test/resources/itest.scdl (original)
+++ incubator/tuscany/java/sca/extensions/spring/integration-test/core/src/test/resources/itest.scdl Wed Feb 28 12:17:24 2007
@@ -20,7 +20,8 @@
 <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
            xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
            xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
-           name="SpecTestHarnessComposite">
+           name="SpecTestHarnessComposite"
+			  autowire="true">
 
     <include scdlResource="META-INF/sca/spring.composite.scdl"/>
 

Modified: incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceImpl.java?view=diff&rev=512945&r1=512944&r2=512945
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceImpl.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceImpl.java Wed Feb 28 12:17:24 2007
@@ -31,7 +31,6 @@
 import org.osoa.sca.annotations.Reference;
 import org.osoa.sca.annotations.Remotable;
 
-import org.apache.tuscany.spi.annotation.Autowire;
 import org.apache.tuscany.spi.databinding.extension.SimpleTypeMapperExtension;
 import org.apache.tuscany.spi.idl.InvalidServiceContractException;
 import org.apache.tuscany.spi.idl.TypeInfo;
@@ -115,10 +114,7 @@
         List<String> injectionNames) throws ProcessingException {
         boolean processed = false;
         for (Annotation annot : paramAnnotations) {
-            if (Autowire.class.equals(annot.annotationType())) {
-                processed = true;
-                processAutowire(annot, constructorNames, pos, param, genericParam, type, injectionNames);
-            } else if (Property.class.equals(annot.annotationType())) {
+            if (Property.class.equals(annot.annotationType())) {
                 processed = true;
                 processProperty(annot, constructorNames, pos, type, param, genericParam, injectionNames);
             } else if (Reference.class.equals(annot.annotationType())) {
@@ -136,7 +132,7 @@
         for (Annotation[] annotations : annots) {
             for (Annotation annotation : annotations) {
                 Class<? extends Annotation> annotType = annotation.annotationType();
-                if (annotType.equals(Autowire.class) || annotType.equals(Property.class)
+                if (annotType.equals(Property.class)
                     || annotType.equals(Reference.class)
                     || annotType.equals(Resource.class)) {
                     return true;
@@ -186,84 +182,6 @@
         } else {
             return true;
         }
-    }
-
-    /**
-     * Processes autowire metadata for a constructor parameter
-     *
-     * @param annot            the autowire annotation
-     * @param constructorNames the parameter names as specified in an {@link org.osoa.sca.annotations.Constructor}
-     *                         annotation
-     * @param pos              the position of the parameter in the constructor's parameter list
-     * @param param            the parameter type
-     * @param type             the component type associated with the implementation being processed
-     * @param injectionNames   the collection of injection names to update
-     * @throws InvalidAutowireException
-     * @throws InvalidConstructorException
-     */
-    private void processAutowire(
-        Annotation annot,
-        String[] constructorNames,
-        int pos,
-        Class<?> param,
-        Type genericParam,
-        PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type,
-        List<String> injectionNames) throws ProcessingException {
-        // the param is marked as an autowire
-        Autowire autowireAnnot = (Autowire) annot;
-        JavaMappedReference reference = new JavaMappedReference();
-        reference.setAutowire(true);
-        String name = autowireAnnot.name();
-        if (name == null || name.length() == 0) {
-            if (constructorNames.length > 1 && (constructorNames.length < pos + 1 || constructorNames[pos] == null)) {
-                throw new InvalidAutowireException("Names in @Constructor and autowire parameter do not match at "
-                    + (pos + 1));
-            } else if (constructorNames.length == 1 && constructorNames[0].length() == 0) {
-                // special case when @Constructor present with all autowire params not specifying any name 
-                name = param.getName() + String.valueOf(pos);
-            } else if (constructorNames.length == 1
-                && (constructorNames.length < pos + 1 || constructorNames[pos] == null)) {
-                throw new InvalidAutowireException("Names in @Constructor and autowire parameter do not match at "
-                    + (pos + 1));
-            } else if (constructorNames.length == 1 && constructorNames[0].length() > 0) {
-                name = constructorNames[pos];
-            } else if (constructorNames.length == 0 || constructorNames[pos].length() == 0) {
-                name = param.getName() + String.valueOf(pos);
-            } else {
-                name = constructorNames[pos];
-            }
-        } else if (pos < constructorNames.length && constructorNames[pos] != null
-            && constructorNames[pos].length() != 0 && !name.equals(constructorNames[pos])) {
-            String paramNum = String.valueOf(pos + 1);
-            throw new InvalidConstructorException("Name specified by @Constructor does not match autowire name",
-                paramNum);
-        }
-        reference.setUri(URI.create("#" + name));
-        boolean required = autowireAnnot.required();
-        reference.setRequired(required);
-        try {
-            Class<?> rawType = param;
-            if (rawType.isArray() || Collection.class.isAssignableFrom(rawType)) {
-                if (required) {
-                    reference.setMultiplicity(Multiplicity.ONE_N);
-                } else {
-                    reference.setMultiplicity(Multiplicity.ZERO_N);
-                }
-            } else {
-                if (required) {
-                    reference.setMultiplicity(Multiplicity.ONE_ONE);
-                } else {
-                    reference.setMultiplicity(Multiplicity.ZERO_ONE);
-                }
-            }
-            Class<?> baseType = getBaseType(rawType, genericParam);
-            ServiceContract<?> contract = registry.introspect(baseType);
-            reference.setServiceContract(contract);
-        } catch (InvalidServiceContractException e) {
-            throw new ProcessingException(e);
-        }
-        type.getReferences().put(name, reference);
-        addName(injectionNames, pos, name);
     }
 
     /**

Modified: incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessor.java?view=diff&rev=512945&r1=512944&r2=512945
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessor.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessor.java Wed Feb 28 12:17:24 2007
@@ -26,7 +26,6 @@
 
 import org.osoa.sca.annotations.Reference;
 
-import org.apache.tuscany.spi.annotation.Autowire;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
 import org.apache.tuscany.spi.idl.InvalidServiceContractException;
 import org.apache.tuscany.spi.idl.java.JavaInterfaceProcessorRegistry;
@@ -60,29 +59,17 @@
         PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type,
         DeploymentContext context) throws ProcessingException {
         Reference annotation = method.getAnnotation(Reference.class);
-        Autowire autowire = method.getAnnotation(Autowire.class);
-        boolean isAutowire = autowire != null;
-        if (annotation == null && !isAutowire) {
-            return; // Not a reference or autowire annotation.
+        if (annotation == null) {
+            return; // Not a reference annotation.
         }
         if (method.getParameterTypes().length != 1) {
             throw new IllegalReferenceException("Setter must have one parameter", method.toString());
         }
-        // process autowire required first let reference override. or if
-        // conflicting should this fault?
-        boolean required = false;
-        if (isAutowire) {
-            required = autowire.required();
-        }
-
         String name = null;
-
-        if (annotation != null) {
-            if (annotation.name() != null && annotation.name().length() > 0) {
-                name = annotation.name();
-            }
-            required = annotation.required();
+        if (annotation.name() != null && annotation.name().length() > 0) {
+            name = annotation.name();
         }
+        boolean required = annotation.required();
         if (name == null) {
             name = toPropertyName(method.getName());
         }
@@ -92,7 +79,6 @@
 
         JavaMappedReference reference = new JavaMappedReference();
         reference.setMember(method);
-        reference.setAutowire(isAutowire);
         reference.setRequired(required);
         reference.setUri(URI.create("#" + name));
         ServiceContract contract;
@@ -125,18 +111,14 @@
         PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type,
         DeploymentContext context) throws ProcessingException {
         Reference annotation = field.getAnnotation(Reference.class);
-        boolean autowire = field.getAnnotation(Autowire.class) != null;
-        if (annotation == null && !autowire) {
+        if (annotation == null) {
             return;
         }
         String name = field.getName();
-        boolean required = false;
-        if (annotation != null) {
-            if (annotation.name() != null) {
-                name = annotation.name();
-            }
-            required = annotation.required();
+        if (annotation.name() != null) {
+            name = annotation.name();
         }
+        boolean required = annotation.required();
         if (name.length() == 0) {
             name = field.getName();
         }
@@ -146,7 +128,6 @@
         JavaMappedReference reference = new JavaMappedReference();
         reference.setMember(field);
         reference.setRequired(required);
-        reference.setAutowire(autowire);
         reference.setUri(URI.create("#" + name));
         ServiceContract contract;
         try {

Modified: incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/ComponentLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/ComponentLoader.java?view=diff&rev=512945&r1=512944&r2=512945
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/ComponentLoader.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/ComponentLoader.java Wed Feb 28 12:17:24 2007
@@ -161,7 +161,7 @@
                             // add reference target definitions if autowire is enabled for references that are not
                             // explicitly configured with autowire by the component
                             if (!componentDefinition.getReferenceTargets().containsKey(ref.getUri().getFragment())) {
-                                if (ref.getAutowire() || autowire) {
+                                if (autowire) {
                                     ReferenceTarget referenceTarget = new ReferenceTarget();
                                     String compName = componentDefinition.getUri().toString();
                                     URI refName = URI.create(compName + ref.getUri().toString());
@@ -309,7 +309,7 @@
             return;
         }
         for (ReferenceDefinition referenceDef : type.getReferences().values()) {
-            if (referenceDef.getAutowire() || !referenceDef.isRequired()) {
+            if (!referenceDef.isRequired()) {
                 continue;
             }
             String name = referenceDef.getUri().getFragment();

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ConstructorProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ConstructorProcessorTestCase.java?view=diff&rev=512945&r1=512944&r2=512945
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ConstructorProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ConstructorProcessorTestCase.java Wed Feb 28 12:17:24 2007
@@ -26,7 +26,6 @@
 import org.osoa.sca.annotations.Property;
 import org.osoa.sca.annotations.Reference;
 
-import org.apache.tuscany.spi.annotation.Autowire;
 import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
 import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
 import org.apache.tuscany.spi.implementation.java.JavaMappedService;
@@ -87,22 +86,11 @@
             new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
         Constructor<Mixed> ctor1 = Mixed.class.getConstructor(String.class, String.class, String.class);
         processor.visitConstructor(ctor1, type, null);
-        assertEquals("java.lang.String0", type.getConstructorDefinition().getInjectionNames().get(0));
+        assertEquals("_ref0", type.getConstructorDefinition().getInjectionNames().get(0));
         assertEquals("foo", type.getConstructorDefinition().getInjectionNames().get(1));
         assertEquals("bar", type.getConstructorDefinition().getInjectionNames().get(2));
     }
 
-    public void testAllAutowireWithNoNames() throws Exception {
-        PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
-            new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
-        Constructor<AllAutowireNoName> ctor1 =
-            AllAutowireNoName.class.getConstructor(String.class, String.class, String.class);
-        processor.visitConstructor(ctor1, type, null);
-        assertEquals("java.lang.String0", type.getConstructorDefinition().getInjectionNames().get(0));
-        assertEquals("java.lang.String1", type.getConstructorDefinition().getInjectionNames().get(1));
-        assertEquals("java.lang.String2", type.getConstructorDefinition().getInjectionNames().get(2));
-    }
-
     private static class BadFoo {
 
         @org.osoa.sca.annotations.Constructor("foo")
@@ -137,21 +125,15 @@
 
     public static final class Mixed {
         @org.osoa.sca.annotations.Constructor
-        public Mixed(@Autowire String param1,
+        public Mixed(@Reference String param1,
                      @Property(name = "foo")String param2,
                      @Reference(name = "bar")String param3) {
         }
     }
 
-    public static final class AllAutowireNoName {
-        @org.osoa.sca.annotations.Constructor
-        public AllAutowireNoName(@Autowire String param1, @Autowire String param2, @Autowire String param3) {
-        }
-    }
-
     public static final class Multiple {
         @org.osoa.sca.annotations.Constructor
-        public Multiple(@Autowire Collection<String> param1,
+        public Multiple(@Reference Collection<String> param1,
                         @Property(name = "foo")String[] param2,
                         @Reference(name = "bar", required = true)List<String> param3,
                         @Property(name = "abc")Set<String> param4,
@@ -165,9 +147,9 @@
         Constructor<Multiple> ctor1 =
             Multiple.class.getConstructor(Collection.class, String[].class, List.class, Set.class, String[].class);
         processor.visitConstructor(ctor1, type, null);
-        JavaMappedReference ref0 = type.getReferences().get("java.util.Collection0");
+        JavaMappedReference ref0 = type.getReferences().get("_ref0");
         assertNotNull(ref0);
-        assertEquals(Multiplicity.ONE_N, ref0.getMultiplicity());
+        assertEquals(Multiplicity.ZERO_N, ref0.getMultiplicity());
         JavaMappedReference ref1 = type.getReferences().get("bar");
         assertNotNull(ref1);
         assertEquals(Multiplicity.ONE_N, ref1.getMultiplicity());

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicConstructorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicConstructorTestCase.java?view=diff&rev=512945&r1=512944&r2=512945
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicConstructorTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicConstructorTestCase.java Wed Feb 28 12:17:24 2007
@@ -24,7 +24,6 @@
 import org.osoa.sca.annotations.Reference;
 import org.osoa.sca.annotations.Remotable;
 
-import org.apache.tuscany.spi.annotation.Autowire;
 import org.apache.tuscany.spi.idl.java.JavaServiceContract;
 import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
 import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
@@ -146,13 +145,6 @@
         assertNotNull(type.getReferences().get("myRef"));
     }
 
-    public void testConstructorAutowireAnnotatedParamsOnly() throws Exception {
-        PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
-            new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
-        processor.visitEnd(Foo9.class, type, null);
-        assertNotNull(type.getReferences().get("myAutowire"));
-    }
-
     @SuppressWarnings("unchecked")
     public void testDefaultConstructor() throws Exception {
         PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
@@ -181,33 +173,6 @@
         assertNotNull(type.getProperties().get("prop1"));
     }
 
-    public void testAutowire() throws Exception {
-        PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
-            new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
-        processor.visitEnd(Foo13.class, type, null);
-        assertEquals(1, type.getReferences().size());
-        assertNotNull(type.getReferences().get(String.class.getName() + "0"));
-    }
-
-    public void testMultipleAutowire() throws Exception {
-        PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
-            new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
-        processor.visitEnd(Foo15.class, type, null);
-        assertEquals(2, type.getReferences().size());
-        assertNotNull(type.getReferences().get(String.class.getName() + "0"));
-        assertNotNull(type.getReferences().get(String.class.getName() + "1"));
-    }
-
-    public void testNoAutowireNameInConstructor() throws Exception {
-        PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
-            new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
-        processor.visitEnd(Foo16.class, type, null);
-        assertEquals(2, type.getReferences().size());
-        assertNotNull(type.getReferences().get(String.class.getName() + "0"));
-        assertNotNull(type.getReferences().get("bar"));
-        assertNotNull(type.getProperties().get("foo"));
-    }
-
     public void testPrivateConstructor() throws Exception {
         PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
             new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
@@ -274,7 +239,7 @@
     }
 
     public static class Foo9 {
-        public Foo9(@Autowire(name = "myAutowire")String autowire) {
+        public Foo9(@Reference(name = "myRef")String ref) {
         }
     }
 
@@ -308,7 +273,7 @@
     }
 
     public static class Foo13 {
-        public Foo13(@Autowire String foo) {
+        public Foo13(@Reference String foo) {
         }
     }
 
@@ -318,12 +283,12 @@
     }
 
     public static final class Foo15 {
-        public Foo15(@Autowire String param1, @Autowire String param2) {
+        public Foo15(@Reference String param1, @Reference String param2) {
         }
     }
 
     public static final class Foo16 {
-        public Foo16(@Autowire String param1,
+        public Foo16(@Reference String param1,
                      @Property(name = "foo")String param2,
                      @Reference(name = "bar")String param3) {
         }

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/ComponentLoaderValidationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/ComponentLoaderValidationTestCase.java?view=diff&rev=512945&r1=512944&r2=512945
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/ComponentLoaderValidationTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/ComponentLoaderValidationTestCase.java Wed Feb 28 12:17:24 2007
@@ -130,18 +130,6 @@
 
     }
 
-    public void testAutowire() throws LoaderException, XMLStreamException {
-        PojoComponentType<ServiceDefinition, ReferenceDefinition, Property<?>> type =
-            new PojoComponentType<ServiceDefinition, ReferenceDefinition, Property<?>>();
-        ReferenceDefinition refDefinition = new ReferenceDefinition();
-        refDefinition.setUri(URI.create("#name"));
-        refDefinition.setAutowire(true);
-        type.add(refDefinition);
-        JavaImplementation impl = new JavaImplementation(null, type);
-        ComponentDefinition<Implementation<?>> defn = new ComponentDefinition<Implementation<?>>(impl);
-        loader.validate(defn);
-    }
-
     protected void setUp() throws Exception {
         super.setUp();
         LoaderRegistry mockRegistry = EasyMock.createMock(LoaderRegistry.class);

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/resolver/DefaultAutowireResolverTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/resolver/DefaultAutowireResolverTestCase.java?view=diff&rev=512945&r1=512944&r2=512945
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/resolver/DefaultAutowireResolverTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/resolver/DefaultAutowireResolverTestCase.java Wed Feb 28 12:17:24 2007
@@ -130,7 +130,6 @@
         };
         contract.setInterfaceClass(requiredInterface);
         ReferenceDefinition reference = new ReferenceDefinition(URI.create("#ref"), contract);
-        reference.setAutowire(true);
         reference.setRequired(true);
         MockComponentType type = new MockComponentType();
         type.add(reference);

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/ReferenceDefinition.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/ReferenceDefinition.java?view=diff&rev=512945&r1=512944&r2=512945
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/ReferenceDefinition.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/ReferenceDefinition.java Wed Feb 28 12:17:24 2007
@@ -32,7 +32,6 @@
     private URI uri;
     private ServiceContract serviceContract;
     private Multiplicity multiplicity;
-    private boolean autowire;
     private boolean required;
     private List<BindingDefinition> bindings;
 
@@ -77,20 +76,6 @@
 
     public void setMultiplicity(Multiplicity multiplicity) {
         this.multiplicity = multiplicity;
-    }
-
-    /**
-     * @deprecated
-     */
-    public boolean getAutowire() {
-        return autowire;
-    }
-
-    /**
-     * @deprecated
-     */
-    public void setAutowire(boolean autowire) {
-        this.autowire = autowire;
     }
 
     public boolean isRequired() {

Modified: incubator/tuscany/java/sca/runtime/services/discovery/jxta/src/main/java/org/apache/tuscany/service/discovery/jxta/JxtaDiscoveryService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/services/discovery/jxta/src/main/java/org/apache/tuscany/service/discovery/jxta/JxtaDiscoveryService.java?view=diff&rev=512945&r1=512944&r2=512945
==============================================================================
--- incubator/tuscany/java/sca/runtime/services/discovery/jxta/src/main/java/org/apache/tuscany/service/discovery/jxta/JxtaDiscoveryService.java (original)
+++ incubator/tuscany/java/sca/runtime/services/discovery/jxta/src/main/java/org/apache/tuscany/service/discovery/jxta/JxtaDiscoveryService.java Wed Feb 28 12:17:24 2007
@@ -45,13 +45,13 @@
 
 import org.apache.tuscany.service.discovery.jxta.pdp.PeerListener;
 import org.apache.tuscany.service.discovery.jxta.prp.TuscanyQueryHandler;
-import org.apache.tuscany.spi.annotation.Autowire;
 import org.apache.tuscany.spi.services.discovery.AbstractDiscoveryService;
 import org.apache.tuscany.spi.services.discovery.DiscoveryException;
 import org.apache.tuscany.spi.services.work.WorkScheduler;
 import org.apache.tuscany.spi.util.stax.StaxUtil;
 import org.omg.CORBA.Any;
 import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
 
 /**
  * Discovery service implemented using Apple bonjour.
@@ -92,7 +92,7 @@
      * Adds a network configurator for this service.
      * @param configurator Network configurator.
      */
-    @Autowire
+    @Reference
     public void setConfigurator(NetworkConfigurator configurator) {
         this.configurator = configurator;
     }
@@ -101,7 +101,7 @@
      * Adds a work scheduler for runningbackground discovery operations.
      * @param workScheduler Work scheduler.
      */
-    @Autowire
+    @Reference
     public void setWorkScheduler(WorkScheduler workScheduler) {
         this.workScheduler = workScheduler;
     }

Modified: incubator/tuscany/java/sca/runtime/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java?view=diff&rev=512945&r1=512944&r2=512945
==============================================================================
--- incubator/tuscany/java/sca/runtime/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java (original)
+++ incubator/tuscany/java/sca/runtime/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java Wed Feb 28 12:17:24 2007
@@ -22,8 +22,8 @@
 
 import org.osoa.sca.annotations.Destroy;
 import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
 
-import org.apache.tuscany.spi.annotation.Autowire;
 import org.apache.tuscany.spi.services.artifact.Artifact;
 import org.apache.tuscany.spi.services.artifact.ArtifactRepository;
 
@@ -55,7 +55,7 @@
      * Conctructs a new artifact repository.
      */
     public MavenArtifactRepository(@Property(name = "remoteRepoUrl")
-    String remoteRepoUrl, @Autowire
+    String remoteRepoUrl, @Reference
     RuntimeInfo runtimeInfo) {
         mavenHelper = new MavenHelper(remoteRepoUrl, runtimeInfo.isOnline());
         warRepositoryHelper = new WarRepositoryHelper(runtimeInfo.getBaseURL());



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