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/01/25 03:40:56 UTC
svn commit: r499649 - in /incubator/tuscany/java/sca/kernel:
core/src/main/java/org/apache/tuscany/core/implementation/processor/
core/src/test/java/org/apache/tuscany/core/implementation/processor/
host-api/src/main/java/org/apache/tuscany/host/deploy...
Author: jmarino
Date: Wed Jan 24 18:40:55 2007
New Revision: 499649
URL: http://svn.apache.org/viewvc?view=rev&rev=499649
Log:
sourcecheck cleanup
Modified:
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/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/PropertyProcessorTestCase.java
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessorTestCase.java
incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java
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=499649&r1=499648&r2=499649
==============================================================================
--- 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 Jan 24 18:40:55 2007
@@ -111,7 +111,8 @@
Annotation[] paramAnnotations,
String[] constructorNames,
int pos,
- PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type, List<String> injectionNames) throws ProcessingException {
+ PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type,
+ List<String> injectionNames) throws ProcessingException {
boolean processed = false;
for (Annotation annot : paramAnnotations) {
if (Autowire.class.equals(annot.annotationType())) {
@@ -255,7 +256,7 @@
reference.setMultiplicity(Multiplicity.ZERO_ONE);
}
}
- Class<?> baseType = getBaseType(rawType, genericParam);
+ Class<?> baseType = getBaseType(rawType, genericParam);
ServiceContract<?> contract = registry.introspect(baseType);
reference.setServiceContract(contract);
} catch (InvalidServiceContractException e) {
@@ -292,7 +293,7 @@
Class<?> baseType = getBaseType(param, genericParam);
if (param.isArray() || Collection.class.isAssignableFrom(param)) {
property.setMany(true);
- }
+ }
property.setJavaType(baseType);
String name = propAnnot.name();
if (name == null || name.length() == 0) {
@@ -385,7 +386,7 @@
reference.setMultiplicity(Multiplicity.ZERO_ONE);
}
}
- Class<?> baseType = getBaseType(rawType, genericParam);
+ Class<?> baseType = getBaseType(rawType, genericParam);
ServiceContract<?> contract = registry.introspect(baseType);
reference.setServiceContract(contract);
} catch (InvalidServiceContractException e) {
@@ -452,12 +453,12 @@
if (genericType == cls) {
return Object.class;
} else {
- ParameterizedType parameterizedType = (ParameterizedType)genericType;
+ ParameterizedType parameterizedType = (ParameterizedType) genericType;
Type baseType = parameterizedType.getActualTypeArguments()[0];
if (baseType instanceof Class) {
- return (Class<?>)baseType;
+ return (Class<?>) baseType;
} else if (baseType instanceof ParameterizedType) {
- return (Class<?>)((ParameterizedType)baseType).getRawType();
+ return (Class<?>) ((ParameterizedType) baseType).getRawType();
} else {
return null;
}
@@ -465,5 +466,5 @@
} else {
return cls;
}
- }
+ }
}
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=499649&r1=499648&r2=499649
==============================================================================
--- 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 Jan 24 18:40:55 2007
@@ -18,13 +18,13 @@
*/
package org.apache.tuscany.core.implementation.processor;
-import static org.apache.tuscany.core.util.JavaIntrospectionHelper.toPropertyName;
-
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Collection;
+import org.osoa.sca.annotations.Reference;
+
import org.apache.tuscany.spi.annotation.Autowire;
import org.apache.tuscany.spi.component.CompositeComponent;
import org.apache.tuscany.spi.deployer.DeploymentContext;
@@ -38,13 +38,13 @@
import org.apache.tuscany.spi.implementation.java.ProcessingException;
import org.apache.tuscany.spi.model.Multiplicity;
import org.apache.tuscany.spi.model.ServiceContract;
-import org.osoa.sca.annotations.Reference;
+
+import static org.apache.tuscany.core.util.JavaIntrospectionHelper.toPropertyName;
/**
- * Processes an {@link @Reference} annotation, updating the component type with
- * corresponding {@link
+ * Processes an {@link @Reference} annotation, updating the component type with corresponding {@link
* org.apache.tuscany.spi.implementation.java.JavaMappedReference}
- *
+ *
* @version $Rev$ $Date$
*/
public class ReferenceProcessor extends ImplementationProcessorExtension {
@@ -176,7 +176,8 @@
public <T> void visitConstructor(CompositeComponent parent,
Constructor<T> constructor,
- PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type,
+ PojoComponentType<JavaMappedService,
+ JavaMappedReference, JavaMappedProperty<?>> type,
DeploymentContext context) throws ProcessingException {
}
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=499649&r1=499648&r2=499649
==============================================================================
--- 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 Jan 24 18:40:55 2007
@@ -23,17 +23,18 @@
import java.util.List;
import java.util.Set;
-import junit.framework.TestCase;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
-import org.apache.tuscany.core.idl.java.JavaInterfaceProcessorRegistryImpl;
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;
import org.apache.tuscany.spi.implementation.java.PojoComponentType;
import org.apache.tuscany.spi.model.Multiplicity;
-import org.osoa.sca.annotations.Property;
-import org.osoa.sca.annotations.Reference;
+
+import junit.framework.TestCase;
+import org.apache.tuscany.core.idl.java.JavaInterfaceProcessorRegistryImpl;
/**
* @version $Rev$ $Date$
@@ -137,8 +138,8 @@
public static final class Mixed {
@org.osoa.sca.annotations.Constructor
public Mixed(@Autowire String param1,
- @Property(name = "foo") String param2,
- @Reference(name = "bar") String param3) {
+ @Property(name = "foo")String param2,
+ @Reference(name = "bar")String param3) {
}
}
@@ -147,17 +148,17 @@
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,
- @Property(name = "foo") String[] param2,
- @Reference(name = "bar", required=true) List<String> param3,
- @Property(name = "abc") Set<String> param4,
- @Reference(name = "xyz") String[] param5) {
+ @Property(name = "foo")String[] param2,
+ @Reference(name = "bar", required = true)List<String> param3,
+ @Property(name = "abc")Set<String> param4,
+ @Reference(name = "xyz")String[] param5) {
}
- }
-
+ }
+
public void testMultiplicity() throws Exception {
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
@@ -179,6 +180,6 @@
JavaMappedProperty prop2 = type.getProperties().get("abc");
assertNotNull(prop2);
assertTrue(prop2.isMany());
- }
+ }
}
Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/PropertyProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/PropertyProcessorTestCase.java?view=diff&rev=499649&r1=499648&r2=499649
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/PropertyProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/PropertyProcessorTestCase.java Wed Jan 24 18:40:55 2007
@@ -18,14 +18,11 @@
*/
package org.apache.tuscany.core.implementation.processor;
-import static org.apache.tuscany.spi.model.OverrideOptions.MUST;
-
import java.util.Collection;
import java.util.List;
-import junit.framework.TestCase;
+import org.osoa.sca.annotations.Property;
-import org.apache.tuscany.core.idl.java.JavaInterfaceProcessorRegistryImpl;
import org.apache.tuscany.spi.implementation.java.DuplicatePropertyException;
import org.apache.tuscany.spi.implementation.java.IllegalPropertyException;
import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
@@ -33,7 +30,10 @@
import org.apache.tuscany.spi.implementation.java.JavaMappedService;
import org.apache.tuscany.spi.implementation.java.PojoComponentType;
import org.apache.tuscany.spi.model.OverrideOptions;
-import org.osoa.sca.annotations.Property;
+import static org.apache.tuscany.spi.model.OverrideOptions.MUST;
+
+import junit.framework.TestCase;
+import org.apache.tuscany.core.idl.java.JavaInterfaceProcessorRegistryImpl;
/**
* @version $Rev$ $Date$
@@ -157,7 +157,7 @@
}
}
-
+
private class Multiple {
@Property
protected List<String> refs1;
@@ -175,7 +175,7 @@
}
- public void testMultiplicity_Collection() throws Exception {
+ public void testMultiplicityCollection() throws Exception {
processor.visitField(null, Multiple.class.getDeclaredField("refs1"), type, null);
JavaMappedProperty prop = type.getProperties().get("refs1");
assertNotNull(prop);
@@ -183,7 +183,7 @@
assertTrue(prop.isMany());
}
- public void testMultiplicity_Array() throws Exception {
+ public void testMultiplicityArray() throws Exception {
processor.visitField(null, Multiple.class.getDeclaredField("refs2"), type, null);
JavaMappedProperty prop = type.getProperties().get("refs2");
assertNotNull(prop);
@@ -191,20 +191,20 @@
assertTrue(prop.isMany());
}
- public void testMultiplicity_Array_Method() throws Exception {
- processor.visitMethod(null, Multiple.class.getMethod("setRefs3", new Class[] {String[].class}), type, null);
+ public void testMultiplicityArrayMethod() throws Exception {
+ processor.visitMethod(null, Multiple.class.getMethod("setRefs3", String[].class), type, null);
JavaMappedProperty prop = type.getProperties().get("refs3");
assertNotNull(prop);
assertSame(String.class, prop.getJavaType());
assertTrue(prop.isMany());
}
- public void testMultiplicity_Collection_Method() throws Exception {
- processor.visitMethod(null, Multiple.class.getMethod("setRefs4", new Class[] {Collection.class}), type, null);
+ public void testMultiplicityCollectionMethod() throws Exception {
+ processor.visitMethod(null, Multiple.class.getMethod("setRefs4", Collection.class), type, null);
JavaMappedProperty prop = type.getProperties().get("refs4");
assertNotNull(prop);
assertSame(String.class, prop.getJavaType());
assertTrue(prop.isMany());
}
-
+
}
Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessorTestCase.java?view=diff&rev=499649&r1=499648&r2=499649
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessorTestCase.java Wed Jan 24 18:40:55 2007
@@ -193,7 +193,7 @@
}
- public void testMultiplicity_1_N() throws Exception {
+ public void testMultiplicity1ToN() throws Exception {
processor.visitField(null, Multiple.class.getDeclaredField("refs1"), type, null);
JavaMappedReference prop = type.getReferences().get("refs1");
assertNotNull(prop);
@@ -202,7 +202,7 @@
assertTrue(prop.isRequired());
}
- public void testMultiplicity_0_N() throws Exception {
+ public void testMultiplicityTo0ToN() throws Exception {
processor.visitField(null, Multiple.class.getDeclaredField("refs2"), type, null);
JavaMappedReference prop = type.getReferences().get("refs2");
assertNotNull(prop);
@@ -211,8 +211,8 @@
assertFalse(prop.isRequired());
}
- public void testMultiplicity_1_N_Method() throws Exception {
- processor.visitMethod(null, Multiple.class.getMethod("setRefs3", new Class[] {Ref[].class}), type, null);
+ public void testMultiplicity1ToNMethod() throws Exception {
+ processor.visitMethod(null, Multiple.class.getMethod("setRefs3", Ref[].class), type, null);
JavaMappedReference prop = type.getReferences().get("refs3");
assertNotNull(prop);
assertSame(Ref.class, prop.getServiceContract().getInterfaceClass());
@@ -220,8 +220,8 @@
assertTrue(prop.isRequired());
}
- public void testMultiplicity_0_N_Method() throws Exception {
- processor.visitMethod(null, Multiple.class.getMethod("setRefs4", new Class[] {Collection.class}), type, null);
+ public void testMultiplicity0ToNMethod() throws Exception {
+ processor.visitMethod(null, Multiple.class.getMethod("setRefs4", Collection.class), type, null);
JavaMappedReference prop = type.getReferences().get("refs4");
assertNotNull(prop);
assertSame(Ref.class, prop.getServiceContract().getInterfaceClass());
Modified: incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java?view=diff&rev=499649&r1=499648&r2=499649
==============================================================================
--- incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java (original)
+++ incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java Wed Jan 24 18:40:55 2007
@@ -30,10 +30,9 @@
*/
public interface ContributionService {
/**
- * Contribute an artifact to the SCA Domain.
- * The type of the contribution is determined by the Content-Type of the resource
- * or, if that is undefined, by some implementation-specific means (such as
- * mapping an extension in the URL's path).
+ * Contribute an artifact to the SCA Domain. The type of the contribution is determined by the Content-Type of the
+ * resource or, if that is undefined, by some implementation-specific means (such as mapping an extension in the
+ * URL's path).
*
* @param contribution the location of the resource containing the artifact
* @return a URI that uniquely identifies this contribution within the SCA Domain
@@ -46,11 +45,11 @@
* Contribute an artifact to the SCA Domain.
*
* @param source an identifier for the source of this contribution
- * @param contribution a stream containing the resource being contributed; the stream will not be closed
- * but the read position after the call is undefined
- * @param contentType the type of contribution being made; must be a valid Content-Type value
- * as specified by <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC2045</a>
- * and must not be null @return a URI that uniquely identifies this contribution within the SCA Domain
+ * @param contribution a stream containing the resource being contributed; the stream will not be closed but the
+ * read position after the call is undefined
+ * @param contentType the type of contribution being made; must be a valid Content-Type value as specified by <a
+ * href="http://www.ietf.org/rfc/rfc2045.txt">RFC2045</a> and must not be null @return a URI
+ * that uniquely identifies this contribution within the SCA Domain
* @throws DeploymentException if there was a problem with the contribution
* @throws IOException if there was a problem reading the stream
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org