tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r533445 [3/4] - in /incubator/tuscany/java/sca: itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ modules/assembly-java-dsl/src/main/java/org/apache/tuscany/assembly/builder/impl/ modules/assembly-xml/src/main/java/...
Date Sat, 28 Apr 2007 23:52:28 GMT
Modified: incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKCallbackInvocationHandlerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKCallbackInvocationHandlerTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKCallbackInvocationHandlerTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKCallbackInvocationHandlerTestCase.java Sat Apr 28 16:52:22 2007
@@ -25,16 +25,28 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.core.component.WorkContextImpl;
 import org.apache.tuscany.core.wire.WireImpl;
 import org.apache.tuscany.implementation.java.context.ModelHelper;
 import org.apache.tuscany.implementation.java.proxy.JDKCallbackInvocationHandler;
+import org.apache.tuscany.interfacedef.java.JavaFactory;
+import org.apache.tuscany.interfacedef.java.impl.DefaultJavaFactory;
 import org.apache.tuscany.spi.wire.Wire;
 
 /**
  * @version $Rev$ $Date$
  */
 public class JDKCallbackInvocationHandlerTestCase extends TestCase {
+    
+    private AssemblyFactory assemblyFactory;
+    private JavaFactory javaFactory;
+    
+    protected void setUp() throws Exception {
+        assemblyFactory = new DefaultAssemblyFactory();
+        javaFactory = new DefaultJavaFactory();
+    }
 
     public void testToString() {
         Wire wire = new WireImpl();
@@ -42,7 +54,7 @@
         wire.setSourceUri(uri);
         List<Wire> wires = new ArrayList<Wire>();
         wires.add(wire);
-        wire.setSourceContract(ModelHelper.createReference("foo", Foo.class).getInterfaceContract());
+        wire.setSourceContract(ModelHelper.createReference(assemblyFactory, javaFactory, "foo", Foo.class).getInterfaceContract());
         JDKCallbackInvocationHandler handler = new JDKCallbackInvocationHandler(wires, new WorkContextImpl());
         Foo foo = (Foo)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {Foo.class}, handler);
         assertNotNull(foo.toString());
@@ -50,7 +62,7 @@
 
     public void testHashCode() {
         Wire wire = new WireImpl();
-        wire.setSourceContract(ModelHelper.createReference("foo", Foo.class).getInterfaceContract());
+        wire.setSourceContract(ModelHelper.createReference(assemblyFactory, javaFactory, "foo", Foo.class).getInterfaceContract());
         URI uri = URI.create("#wire");
         wire.setSourceUri(uri);
         List<Wire> wires = new ArrayList<Wire>();

Modified: incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKInvocationHandlerProxyTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKInvocationHandlerProxyTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKInvocationHandlerProxyTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKInvocationHandlerProxyTestCase.java Sat Apr 28 16:52:22 2007
@@ -23,14 +23,14 @@
 
 import junit.framework.TestCase;
 
-import org.apache.tuscany.assembly.Contract;
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.core.wire.InvocationChainImpl;
 import org.apache.tuscany.core.wire.WireImpl;
-import org.apache.tuscany.implementation.java.proxy.JDKInvocationHandler;
 import org.apache.tuscany.interfacedef.Operation;
+import org.apache.tuscany.interfacedef.java.JavaFactory;
 import org.apache.tuscany.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.interfacedef.java.impl.JavaInterfaceContractImpl;
+import org.apache.tuscany.interfacedef.java.impl.DefaultJavaFactory;
 import org.apache.tuscany.interfacedef.java.introspect.DefaultJavaInterfaceIntrospector;
 import org.apache.tuscany.interfacedef.java.introspect.JavaInterfaceIntrospectorExtensionPoint;
 import org.apache.tuscany.spi.wire.InvocationChain;
@@ -43,7 +43,7 @@
  * @version $Rev$ $Date$
  */
 public class JDKInvocationHandlerProxyTestCase extends TestCase {
-    private JavaInterfaceIntrospectorExtensionPoint introspector = new DefaultJavaInterfaceIntrospector();
+    private JavaInterfaceIntrospectorExtensionPoint introspector = new DefaultJavaInterfaceIntrospector(new DefaultJavaFactory());
     private Method clientHello;
 
     /**
@@ -52,8 +52,9 @@
      */
     public void testDifferentInterface() throws Throwable {
         Wire wire = new WireImpl();
-
-        JavaInterfaceContract interfaceContract = new JavaInterfaceContractImpl();
+        
+        JavaFactory javaFactory = new DefaultJavaFactory();
+        JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
         interfaceContract.setInterface(introspector.introspect(Target.class));
         for (Operation operation : interfaceContract.getInterface().getOperations()) {
             InvocationChain chain = new InvocationChainImpl(operation);

Modified: incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKInvocationHandlerSerializationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKInvocationHandlerSerializationTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKInvocationHandlerSerializationTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKInvocationHandlerSerializationTestCase.java Sat Apr 28 16:52:22 2007
@@ -30,13 +30,17 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Contract;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.core.component.WorkContextImpl;
 import org.apache.tuscany.core.wire.InvocationChainImpl;
 import org.apache.tuscany.core.wire.InvokerInterceptor;
 import org.apache.tuscany.implementation.java.context.ModelHelper;
 import org.apache.tuscany.interfacedef.Operation;
 import org.apache.tuscany.interfacedef.impl.OperationImpl;
+import org.apache.tuscany.interfacedef.java.JavaFactory;
+import org.apache.tuscany.interfacedef.java.impl.DefaultJavaFactory;
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.WorkContextTunnel;
 import org.apache.tuscany.spi.component.SCAObject;
@@ -56,6 +60,9 @@
     private WorkContext workContext;
     private TargetInvoker invoker;
 
+    private AssemblyFactory assemblyFactory;
+    private JavaFactory javaFactory;
+    
     public void testSerializeDeserialize() throws Throwable {
         JDKInvocationHandler handler =
             new JDKInvocationHandler(Foo.class, wire, workContext);
@@ -80,15 +87,17 @@
     }
 
     protected void setUp() throws Exception {
-        super.setUp();
+        assemblyFactory = new DefaultAssemblyFactory();
+        javaFactory = new DefaultJavaFactory();
+        
         SCAObject container = EasyMock.createMock(SCAObject.class);
-        Contract contract = ModelHelper.createReference("foo", Foo.class);
+        Contract contract = ModelHelper.createReference(assemblyFactory, javaFactory, "foo", Foo.class);
         EasyMock.expect(container.getUri()).andReturn(URI.create("bar")).atLeastOnce();
 
         wire = EasyMock.createMock(Wire.class);
         List<InvocationChain> map = new ArrayList<InvocationChain>();
         Operation operation = new OperationImpl("invoke");
-        Contract opContract = ModelHelper.createReference("foo", Foo.class);
+        Contract opContract = ModelHelper.createReference(assemblyFactory, javaFactory, "foo", Foo.class);
         operation.setInterface(opContract.getInterfaceContract().getInterface());
         map.add(createChain(operation));
         EasyMock.expect(wire.getSourceContract()).andReturn(contract.getInterfaceContract()).atLeastOnce();

Modified: incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKInvocationHandlerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKInvocationHandlerTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKInvocationHandlerTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKInvocationHandlerTestCase.java Sat Apr 28 16:52:22 2007
@@ -28,7 +28,9 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Contract;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.core.component.SimpleWorkContext;
 import org.apache.tuscany.core.wire.InvocationChainImpl;
 import org.apache.tuscany.core.wire.WireImpl;
@@ -37,6 +39,8 @@
 import org.apache.tuscany.interfacedef.Operation;
 import org.apache.tuscany.interfacedef.impl.DataTypeImpl;
 import org.apache.tuscany.interfacedef.impl.OperationImpl;
+import org.apache.tuscany.interfacedef.java.JavaFactory;
+import org.apache.tuscany.interfacedef.java.impl.DefaultJavaFactory;
 import org.apache.tuscany.spi.Scope;
 import org.apache.tuscany.spi.component.WorkContextTunnel;
 import org.apache.tuscany.spi.component.WorkContext;
@@ -51,9 +55,17 @@
  */
 public class JDKInvocationHandlerTestCase extends TestCase {
 
+    private AssemblyFactory assemblyFactory;
+    private JavaFactory javaFactory;
+    
+    protected void setUp() throws Exception {
+        assemblyFactory = new DefaultAssemblyFactory();
+        javaFactory = new DefaultJavaFactory();
+    }
+
     public void testToString() {
         Wire wire = new WireImpl();
-        Contract contract = ModelHelper.createReference("foo", Foo.class);
+        Contract contract = ModelHelper.createReference(assemblyFactory, javaFactory, "foo", Foo.class);
         wire.setSourceContract(contract.getInterfaceContract());
         wire.setSourceUri(URI.create("foo#bar"));
         JDKInvocationHandler handler = new JDKInvocationHandler(Foo.class, wire, null);
@@ -63,7 +75,7 @@
 
     public void testHashCode() {
         Wire wire = new WireImpl();
-        Contract contract = ModelHelper.createReference("foo", Foo.class);
+        Contract contract = ModelHelper.createReference(assemblyFactory, javaFactory, "foo", Foo.class);
         wire.setSourceContract(contract.getInterfaceContract());
         wire.setSourceUri(URI.create("foo#bar"));
         JDKInvocationHandler handler = new JDKInvocationHandler(Foo.class, wire, null);
@@ -81,7 +93,7 @@
         Operation op1 = new OperationImpl("test");
         op1.setInputType(inputType1);
         op1.setOutputType(outputType1);
-        Contract contract = ModelHelper.createReference("foo", Foo.class);
+        Contract contract = ModelHelper.createReference(assemblyFactory, javaFactory, "foo", Foo.class);
         op1.setInterface(contract.getInterfaceContract().getInterface());
 
         WorkContext wc = new SimpleWorkContext();

Modified: incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKProxyTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKProxyTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKProxyTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/implementation/java/proxy/JDKProxyTestCase.java Sat Apr 28 16:52:22 2007
@@ -26,10 +26,9 @@
 import org.apache.tuscany.assembly.Contract;
 import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.core.wire.WireImpl;
-import org.apache.tuscany.implementation.java.proxy.JDKProxyService;
 import org.apache.tuscany.interfacedef.InterfaceContract;
-import org.apache.tuscany.interfacedef.java.impl.JavaInterfaceContractImpl;
-import org.apache.tuscany.interfacedef.java.impl.JavaInterfaceImpl;
+import org.apache.tuscany.interfacedef.java.JavaFactory;
+import org.apache.tuscany.interfacedef.java.impl.DefaultJavaFactory;
 import org.apache.tuscany.spi.wire.Wire;
 
 /**
@@ -43,8 +42,9 @@
         Wire wire = new WireImpl();
         wire.setSourceUri(uri);
         Contract contract = new DefaultAssemblyFactory().createComponentReference();
-        InterfaceContract interfaceContract = new JavaInterfaceContractImpl();
-        interfaceContract.setInterface(new JavaInterfaceImpl());
+        JavaFactory javaFactory = new DefaultJavaFactory();
+        InterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
+        interfaceContract.setInterface(javaFactory.createJavaInterface());
         contract.setInterfaceContract(interfaceContract);
         wire.setSourceContract(contract.getInterfaceContract());
         TestInterface proxy = proxyService.createProxy(TestInterface.class, wire);

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/BaseJavaClassIntrospectorExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/BaseJavaClassIntrospectorExtension.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/BaseJavaClassIntrospectorExtension.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/BaseJavaClassIntrospectorExtension.java Sat Apr 28 16:52:22 2007
@@ -23,7 +23,6 @@
 import java.lang.reflect.Method;
 
 import org.apache.tuscany.assembly.AssemblyFactory;
-import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.impl.Parameter;
 
@@ -34,10 +33,10 @@
  * @version $Rev$ $Date$
  */
 public abstract class BaseJavaClassIntrospectorExtension implements JavaClassIntrospectorExtension {
-    protected AssemblyFactory factory;
+    protected AssemblyFactory assemblyFactory;
     
-    public BaseJavaClassIntrospectorExtension() {
-        this.factory = new DefaultAssemblyFactory();
+    public BaseJavaClassIntrospectorExtension(AssemblyFactory factory) {
+        this.assemblyFactory = factory;
     }
 
     public <T> void visitClass(Class<T> clazz, JavaImplementationDefinition type) throws IntrospectionException {

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/AbstractPropertyProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/AbstractPropertyProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/AbstractPropertyProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/AbstractPropertyProcessor.java Sat Apr 28 16:52:22 2007
@@ -24,6 +24,7 @@
 import java.util.Collection;
 import java.util.Map;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Property;
 import org.apache.tuscany.implementation.java.impl.JavaElement;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
@@ -43,8 +44,8 @@
 public abstract class AbstractPropertyProcessor<A extends Annotation> extends BaseJavaClassIntrospectorExtension {
     private final Class<A> annotationClass;
     
-    
-    protected AbstractPropertyProcessor(Class<A> annotationClass) {
+    protected AbstractPropertyProcessor(AssemblyFactory assemblyFactory, Class<A> annotationClass) {
+        super(assemblyFactory);
         this.annotationClass = annotationClass;
     }
 
@@ -151,7 +152,7 @@
     @SuppressWarnings("unchecked")
     protected  Property createProperty(String name, JavaElement element) throws IntrospectionException {
 
-        Property property = factory.createProperty();
+        Property property = assemblyFactory.createProperty();
         property.setName(name);
         Class<?> baseType = JavaIntrospectionHelper.getBaseType(element.getType(), element.getGenericType());
         property.setXSDType(JavaXMLMapper.getXMLType(baseType));

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/AllowsPassByReferenceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/AllowsPassByReferenceProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/AllowsPassByReferenceProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/AllowsPassByReferenceProcessor.java Sat Apr 28 16:52:22 2007
@@ -20,6 +20,7 @@
 
 import java.lang.reflect.Method;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.introspect.BaseJavaClassIntrospectorExtension;
 import org.apache.tuscany.implementation.java.introspect.IntrospectionException;
@@ -32,6 +33,10 @@
  */
 public class AllowsPassByReferenceProcessor extends BaseJavaClassIntrospectorExtension {
     
+    public AllowsPassByReferenceProcessor(AssemblyFactory factory) {
+        super(factory);
+    }
+
     public <T> void visitClass(Class<T> clazz, JavaImplementationDefinition type) throws IntrospectionException {
         type.setAllowsPassByReference(clazz.isAnnotationPresent(AllowsPassByReference.class));
     }

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ConstructorProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ConstructorProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ConstructorProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ConstructorProcessor.java Sat Apr 28 16:52:22 2007
@@ -20,6 +20,7 @@
 
 import java.lang.reflect.Constructor;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.ConstructorDefinition;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.impl.Parameter;
@@ -34,6 +35,10 @@
  */
 @SuppressWarnings("unchecked")
 public class ConstructorProcessor extends BaseJavaClassIntrospectorExtension {
+    
+    public ConstructorProcessor(AssemblyFactory factory) {
+        super(factory);
+    }
 
     public <T> void visitClass(Class<T> clazz, JavaImplementationDefinition type) throws IntrospectionException {
         Constructor[] ctors = clazz.getConstructors();

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ContextProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ContextProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ContextProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ContextProcessor.java Sat Apr 28 16:52:22 2007
@@ -21,6 +21,7 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaElement;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.impl.Resource;
@@ -39,6 +40,10 @@
  */
 public class ContextProcessor extends BaseJavaClassIntrospectorExtension {
     
+    public ContextProcessor(AssemblyFactory factory) {
+        super(factory);
+    }
+
     public void visitMethod(Method method, JavaImplementationDefinition type) throws IntrospectionException {
         if (method.getAnnotation(Context.class) == null) {
             return;

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ConversationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ConversationProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ConversationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ConversationProcessor.java Sat Apr 28 16:52:22 2007
@@ -21,6 +21,7 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.introspect.BaseJavaClassIntrospectorExtension;
 import org.apache.tuscany.implementation.java.introspect.IntrospectionException;
@@ -38,6 +39,10 @@
     private static final String DAYS = " DAYS";
     private static final String YEARS = " YEARS";
     
+    public ConversationProcessor(AssemblyFactory factory) {
+        super(factory);
+    }
+
     public <T> void visitClass(Class<T> clazz, JavaImplementationDefinition type) throws IntrospectionException {
 
         ConversationAttributes conversation = clazz.getAnnotation(ConversationAttributes.class);

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/DestroyProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/DestroyProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/DestroyProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/DestroyProcessor.java Sat Apr 28 16:52:22 2007
@@ -21,6 +21,7 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.introspect.BaseJavaClassIntrospectorExtension;
 import org.apache.tuscany.implementation.java.introspect.IntrospectionException;
@@ -34,6 +35,10 @@
  */
 public class DestroyProcessor extends BaseJavaClassIntrospectorExtension {
     
+    public DestroyProcessor(AssemblyFactory factory) {
+        super(factory);
+    }
+
     public void visitMethod(Method method, JavaImplementationDefinition type) throws IntrospectionException {
         Destroy annotation = method.getAnnotation(Destroy.class);
         if (annotation == null) {

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/EagerInitProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/EagerInitProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/EagerInitProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/EagerInitProcessor.java Sat Apr 28 16:52:22 2007
@@ -18,6 +18,7 @@
  */
 package org.apache.tuscany.implementation.java.introspect.impl;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.introspect.BaseJavaClassIntrospectorExtension;
 import org.apache.tuscany.implementation.java.introspect.IntrospectionException;
@@ -30,6 +31,10 @@
  */
 public class EagerInitProcessor extends BaseJavaClassIntrospectorExtension {
     
+    public EagerInitProcessor(AssemblyFactory factory) {
+        super(factory);
+    }
+
     public <T> void visitClass(Class<T> clazz,
                                JavaImplementationDefinition type) throws IntrospectionException {
         super.visitClass(clazz, type);

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicPojoProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicPojoProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicPojoProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicPojoProcessor.java Sat Apr 28 16:52:22 2007
@@ -40,6 +40,7 @@
 
 import org.apache.tuscany.api.annotation.Monitor;
 import org.apache.tuscany.api.annotation.Resource;
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Contract;
 import org.apache.tuscany.assembly.Multiplicity;
 import org.apache.tuscany.implementation.java.impl.ConstructorDefinition;
@@ -53,9 +54,7 @@
 import org.apache.tuscany.interfacedef.java.JavaFactory;
 import org.apache.tuscany.interfacedef.java.JavaInterface;
 import org.apache.tuscany.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.interfacedef.java.impl.DefaultJavaFactory;
-import org.apache.tuscany.interfacedef.java.impl.JavaInterfaceContractImpl;
-import org.apache.tuscany.interfacedef.java.introspect.JavaInterfaceIntrospectorExtensionPoint;
+import org.apache.tuscany.interfacedef.java.introspect.JavaInterfaceIntrospector;
 import org.apache.tuscany.interfacedef.util.JavaXMLMapper;
 import org.osoa.sca.annotations.Callback;
 import org.osoa.sca.annotations.Property;
@@ -77,11 +76,12 @@
  */
 public class HeuristicPojoProcessor extends BaseJavaClassIntrospectorExtension {
     private JavaFactory javaFactory;
-    private JavaInterfaceIntrospectorExtensionPoint interfaceIntrospector;
+    private JavaInterfaceIntrospector interfaceIntrospector;
 
-    public HeuristicPojoProcessor(JavaInterfaceIntrospectorExtensionPoint interfaceIntrospector) {
+    public HeuristicPojoProcessor(AssemblyFactory assemblyFactory, JavaFactory javaFactory, JavaInterfaceIntrospector interfaceIntrospector) {
+        super(assemblyFactory);
         this.interfaceIntrospector = interfaceIntrospector;
-        this.javaFactory = new DefaultJavaFactory();
+        this.javaFactory = javaFactory;
     }
 
     public <T> void visitEnd(Class<T> clazz, JavaImplementationDefinition type) throws IntrospectionException {
@@ -482,7 +482,7 @@
      * @param paramType the property type
      */
     private org.apache.tuscany.assembly.Property createProperty(String name, Class<?> paramType) {
-        org.apache.tuscany.assembly.Property property = factory.createProperty();
+        org.apache.tuscany.assembly.Property property = assemblyFactory.createProperty();
         property.setName(name);
         property.setXSDType(JavaXMLMapper.getXMLType(paramType));
         return property;
@@ -575,9 +575,9 @@
 
     public org.apache.tuscany.assembly.Reference createReference(String name, Class<?> paramType)
         throws IntrospectionException {
-        org.apache.tuscany.assembly.Reference reference = factory.createReference();
+        org.apache.tuscany.assembly.Reference reference = assemblyFactory.createReference();
         reference.setName(name);
-        JavaInterfaceContract interfaceContract = new JavaInterfaceContractImpl();
+        JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
         reference.setInterfaceContract(interfaceContract);
         try {
             JavaInterface callInterface = interfaceIntrospector.introspect(paramType);
@@ -599,10 +599,10 @@
     }
 
     public org.apache.tuscany.assembly.Service createService(Class<?> interfaze) throws InvalidInterfaceException {
-        org.apache.tuscany.assembly.Service service = factory.createService();
+        org.apache.tuscany.assembly.Service service = assemblyFactory.createService();
         service.setName(interfaze.getSimpleName());
 
-        JavaInterfaceContract interfaceContract = new JavaInterfaceContractImpl();
+        JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
         service.setInterfaceContract(interfaceContract);
         
         JavaInterface callInterface = interfaceIntrospector.introspect(interfaze);

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/InitProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/InitProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/InitProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/InitProcessor.java Sat Apr 28 16:52:22 2007
@@ -21,6 +21,7 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.introspect.BaseJavaClassIntrospectorExtension;
 import org.apache.tuscany.implementation.java.introspect.IntrospectionException;
@@ -34,6 +35,10 @@
  */
 public class InitProcessor extends BaseJavaClassIntrospectorExtension {
     
+    public InitProcessor(AssemblyFactory factory) {
+        super(factory);
+    }
+
     public void visitMethod(Method method, JavaImplementationDefinition type) throws IntrospectionException {
         Init annotation = method.getAnnotation(Init.class);
         if (annotation == null) {

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/PolicyProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/PolicyProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/PolicyProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/PolicyProcessor.java Sat Apr 28 16:52:22 2007
@@ -23,6 +23,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Callback;
 import org.apache.tuscany.assembly.Service;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
@@ -34,7 +35,6 @@
 import org.apache.tuscany.interfacedef.java.JavaInterfaceContract;
 import org.apache.tuscany.policy.Intent;
 import org.apache.tuscany.policy.PolicyFactory;
-import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 import org.osoa.sca.annotations.Requires;
 
 /**
@@ -43,11 +43,12 @@
  * @version $Rev:
  */
 public class PolicyProcessor extends BaseJavaClassIntrospectorExtension {
-
+    
     private PolicyFactory policyFactory;
 
-    public PolicyProcessor() {
-        this.policyFactory = new DefaultPolicyFactory();
+    public PolicyProcessor(AssemblyFactory assemblyFactory, PolicyFactory policyFactory) {
+        super(assemblyFactory);
+        this.policyFactory = policyFactory;
     }
 
     private QName getQName(String intentName) {
@@ -91,7 +92,7 @@
         if (intentAnnotation != null) {
             String[] intentNames = intentAnnotation.value();
             if (intentNames.length != 0) {
-                Operation operation = factory.createOperation();
+                Operation operation = assemblyFactory.createOperation();
                 operation.setName(method.getName());
                 operation.setUnresolved(true);
                 for (String intentName : intentNames) {
@@ -140,7 +141,7 @@
                     if (javaCallbackInterface.getJavaClass() != null) {
                         Callback callback = service.getCallback();
                         if (callback == null) {
-                            callback = factory.createCallback();
+                            callback = assemblyFactory.createCallback();
                             service.setCallback(callback);
                         }
                         readIntents(javaCallbackInterface.getJavaClass(), callback.getRequiredIntents());

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/PropertyProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/PropertyProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/PropertyProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/PropertyProcessor.java Sat Apr 28 16:52:22 2007
@@ -18,6 +18,7 @@
  */
 package org.apache.tuscany.implementation.java.introspect.impl;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.osoa.sca.annotations.Property;
 
 /**
@@ -28,8 +29,8 @@
  */
 public class PropertyProcessor extends AbstractPropertyProcessor<Property> {
     
-    public PropertyProcessor() {
-        super(Property.class);
+    public PropertyProcessor(AssemblyFactory assemblyFactory) {
+        super(assemblyFactory, Property.class);
     }
 
     protected String getName(Property annotation) {

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ReferenceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ReferenceProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ReferenceProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ReferenceProcessor.java Sat Apr 28 16:52:22 2007
@@ -25,17 +25,17 @@
 import java.lang.reflect.Type;
 import java.util.Collection;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Multiplicity;
-import org.apache.tuscany.assembly.impl.ReferenceImpl;
 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.introspect.BaseJavaClassIntrospectorExtension;
 import org.apache.tuscany.implementation.java.introspect.IntrospectionException;
 import org.apache.tuscany.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.interfacedef.java.JavaFactory;
 import org.apache.tuscany.interfacedef.java.JavaInterface;
 import org.apache.tuscany.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.interfacedef.java.impl.JavaInterfaceContractImpl;
 import org.apache.tuscany.interfacedef.java.introspect.JavaInterfaceIntrospectorExtensionPoint;
 import org.osoa.sca.annotations.Reference;
 
@@ -48,8 +48,11 @@
  */
 public class ReferenceProcessor extends BaseJavaClassIntrospectorExtension {
     private JavaInterfaceIntrospectorExtensionPoint interfaceIntrospector;
+    private JavaFactory javaFactory;
     
-    public ReferenceProcessor(JavaInterfaceIntrospectorExtensionPoint interfaceIntrospector) {
+    public ReferenceProcessor(AssemblyFactory assemblyFactory, JavaFactory javaFactory, JavaInterfaceIntrospectorExtensionPoint interfaceIntrospector) {
+        super(assemblyFactory);
+        this.javaFactory = javaFactory;
         this.interfaceIntrospector = interfaceIntrospector;
     }
 
@@ -126,8 +129,8 @@
     }
 
     private org.apache.tuscany.assembly.Reference createReference(JavaElement element, String name) throws IntrospectionException {
-        org.apache.tuscany.assembly.Reference reference = new ReferenceImpl();
-        JavaInterfaceContract interfaceContract = new JavaInterfaceContractImpl();
+        org.apache.tuscany.assembly.Reference reference = assemblyFactory.createReference();
+        JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
         reference.setInterfaceContract(interfaceContract);
         
         // reference.setMember((Member)element.getAnchor());

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ResourceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ResourceProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ResourceProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ResourceProcessor.java Sat Apr 28 16:52:22 2007
@@ -22,6 +22,7 @@
 import java.lang.reflect.Member;
 import java.lang.reflect.Method;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaElement;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.impl.Parameter;
@@ -36,6 +37,10 @@
  * @version $Rev$ $Date$
  */
 public class ResourceProcessor extends BaseJavaClassIntrospectorExtension {
+    
+    public ResourceProcessor(AssemblyFactory factory) {
+        super(factory);
+    }
 
     public void visitMethod(Method method, JavaImplementationDefinition type) throws IntrospectionException {
         org.apache.tuscany.api.annotation.Resource annotation = method

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ScopeProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ScopeProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ScopeProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ScopeProcessor.java Sat Apr 28 16:52:22 2007
@@ -18,6 +18,7 @@
  */
 package org.apache.tuscany.implementation.java.introspect.impl;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.impl.Scope;
 import org.apache.tuscany.implementation.java.introspect.BaseJavaClassIntrospectorExtension;
@@ -30,6 +31,10 @@
  */
 public class ScopeProcessor extends BaseJavaClassIntrospectorExtension {
     
+    public ScopeProcessor(AssemblyFactory factory) {
+        super(factory);
+    }
+
     public <T> void visitClass(Class<T> clazz,
                                JavaImplementationDefinition type)
         throws IntrospectionException {

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ServiceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ServiceProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ServiceProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/ServiceProcessor.java Sat Apr 28 16:52:22 2007
@@ -25,15 +25,16 @@
 import java.lang.reflect.Method;
 import java.util.Set;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Service;
 import org.apache.tuscany.implementation.java.impl.JavaElement;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.introspect.BaseJavaClassIntrospectorExtension;
 import org.apache.tuscany.implementation.java.introspect.IntrospectionException;
 import org.apache.tuscany.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.interfacedef.java.JavaFactory;
 import org.apache.tuscany.interfacedef.java.JavaInterface;
 import org.apache.tuscany.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.interfacedef.java.impl.JavaInterfaceContractImpl;
 import org.apache.tuscany.interfacedef.java.introspect.JavaInterfaceIntrospectorExtensionPoint;
 import org.osoa.sca.annotations.Callback;
 import org.osoa.sca.annotations.Remotable;
@@ -47,8 +48,11 @@
  */
 public class ServiceProcessor extends BaseJavaClassIntrospectorExtension {
     private JavaInterfaceIntrospectorExtensionPoint interfaceIntrospector;
+    private JavaFactory javaFactory;
     
-    public ServiceProcessor(JavaInterfaceIntrospectorExtensionPoint interfaceIntrospector) {
+    public ServiceProcessor(AssemblyFactory assemblyFactory, JavaFactory javaFactory, JavaInterfaceIntrospectorExtensionPoint interfaceIntrospector) {
+        super(assemblyFactory);
+        this.javaFactory = javaFactory;
         this.interfaceIntrospector = interfaceIntrospector;
     }
 
@@ -140,8 +144,8 @@
     }
 
     public Service createService(Class<?> interfaze) throws InvalidInterfaceException {
-        Service service = factory.createService();
-        JavaInterfaceContract interfaceContract = new JavaInterfaceContractImpl();
+        Service service = assemblyFactory.createService();
+        JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
         service.setInterfaceContract(interfaceContract);
 
         // create a relative URI

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/xml/JavaImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/xml/JavaImplementationProcessor.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/xml/JavaImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/xml/JavaImplementationProcessor.java Sat Apr 28 16:52:22 2007
@@ -27,8 +27,6 @@
 import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.tuscany.assembly.AssemblyFactory;
-import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
-import org.apache.tuscany.assembly.impl.ServiceImpl;
 import org.apache.tuscany.assembly.xml.BaseArtifactProcessor;
 import org.apache.tuscany.assembly.xml.Constants;
 import org.apache.tuscany.contribution.processor.StAXArtifactProcessorExtension;
@@ -40,43 +38,26 @@
 import org.apache.tuscany.contribution.service.ContributionWriteException;
 import org.apache.tuscany.implementation.java.JavaImplementation;
 import org.apache.tuscany.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.implementation.java.impl.DefaultJavaImplementationFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
-import org.apache.tuscany.implementation.java.introspect.DefaultJavaClassIntrospector;
 import org.apache.tuscany.implementation.java.introspect.IntrospectionException;
-import org.apache.tuscany.implementation.java.introspect.JavaClassIntrospectorExtensionPoint;
+import org.apache.tuscany.implementation.java.introspect.JavaClassIntrospector;
 import org.apache.tuscany.policy.PolicyFactory;
-import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 
 public class JavaImplementationProcessor extends BaseArtifactProcessor implements StAXArtifactProcessorExtension<JavaImplementation>,
     JavaImplementationConstants {
 
     private JavaImplementationFactory javaFactory;
-    private JavaClassIntrospectorExtensionPoint introspector;
+    private JavaClassIntrospector introspector;
 
     public JavaImplementationProcessor(AssemblyFactory assemblyFactory,
                                        PolicyFactory policyFactory,
                                        JavaImplementationFactory javaFactory,
-                                       JavaClassIntrospectorExtensionPoint introspector) {
+                                       JavaClassIntrospector introspector) {
         super(assemblyFactory, policyFactory, null);
         this.javaFactory = javaFactory;
         this.introspector = introspector;
     }
 
-    public JavaImplementationProcessor(JavaClassIntrospectorExtensionPoint introspector) {
-        this(new DefaultAssemblyFactory(),
-             new DefaultPolicyFactory(),
-             new DefaultJavaImplementationFactory(new DefaultAssemblyFactory()),
-             introspector);
-    }
-
-    public JavaImplementationProcessor() {
-        this(new DefaultAssemblyFactory(),
-             new DefaultPolicyFactory(),
-             new DefaultJavaImplementationFactory(new DefaultAssemblyFactory()),
-             new DefaultJavaClassIntrospector());
-    }
-
     public JavaImplementation read(XMLStreamReader reader) throws ContributionReadException {
 
         try {
@@ -137,7 +118,7 @@
             
             //FIXME the introspector should always create at least one service
             if (javaImplementation.getServices().isEmpty()) {
-                javaImplementation.getServices().add(new ServiceImpl());
+                javaImplementation.getServices().add(assemblyFactory.createService());
             }
         }
     }

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/AbstractProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/AbstractProcessorTest.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/AbstractProcessorTest.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/AbstractProcessorTest.java Sat Apr 28 16:52:22 2007
@@ -28,12 +28,9 @@
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.impl.Parameter;
 import org.apache.tuscany.implementation.java.introspect.IntrospectionException;
-import org.apache.tuscany.implementation.java.introspect.impl.ConstructorProcessor;
-import org.apache.tuscany.implementation.java.introspect.impl.PropertyProcessor;
-import org.apache.tuscany.implementation.java.introspect.impl.ReferenceProcessor;
-import org.apache.tuscany.implementation.java.introspect.impl.ResourceProcessor;
+import org.apache.tuscany.interfacedef.java.JavaFactory;
+import org.apache.tuscany.interfacedef.java.impl.DefaultJavaFactory;
 import org.apache.tuscany.interfacedef.java.introspect.DefaultJavaInterfaceIntrospector;
-import org.apache.tuscany.interfacedef.java.introspect.JavaInterfaceIntrospectorExtensionPoint;
 
 
 /**
@@ -42,18 +39,23 @@
  * @version $Rev$ $Date$
  */
 public class AbstractProcessorTest extends TestCase {
-    protected AssemblyFactory factory = new DefaultAssemblyFactory();
+    protected AssemblyFactory factory;
+    protected JavaFactory javaFactory;
     protected ConstructorProcessor constructorProcessor;
-    private ReferenceProcessor referenceProcessor = new ReferenceProcessor(new DefaultJavaInterfaceIntrospector());
-    private PropertyProcessor propertyProcessor = new PropertyProcessor();
-    private ResourceProcessor resourceProcessor = new ResourceProcessor();
-    // private MonitorProcessor monitorProcessor = new MonitorProcessor(new NullMonitorFactory());
+    private ReferenceProcessor referenceProcessor;
+    private PropertyProcessor propertyProcessor;
+    private ResourceProcessor resourceProcessor;
 
 
     protected AbstractProcessorTest() {
-        constructorProcessor = new ConstructorProcessor();
-        referenceProcessor = new ReferenceProcessor(new DefaultJavaInterfaceIntrospector());
-        propertyProcessor = new PropertyProcessor();
+        factory = new DefaultAssemblyFactory();
+        javaFactory = new DefaultJavaFactory();
+        referenceProcessor = new ReferenceProcessor(factory, javaFactory, new DefaultJavaInterfaceIntrospector(javaFactory));
+        propertyProcessor = new PropertyProcessor(factory);
+        resourceProcessor = new ResourceProcessor(factory);
+        constructorProcessor = new ConstructorProcessor(factory);
+        referenceProcessor = new ReferenceProcessor(factory, javaFactory, new DefaultJavaInterfaceIntrospector(javaFactory));
+        propertyProcessor = new PropertyProcessor(factory);
     }
 
     protected <T> void visitConstructor(Constructor<T> constructor,

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/AbstractPropertyProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/AbstractPropertyProcessorTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/AbstractPropertyProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/AbstractPropertyProcessorTestCase.java Sat Apr 28 16:52:22 2007
@@ -29,13 +29,13 @@
 import junit.framework.TestCase;
 
 import org.apache.tuscany.assembly.Property;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.ConstructorDefinition;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.impl.Parameter;
 import org.apache.tuscany.implementation.java.introspect.DuplicatePropertyException;
 import org.apache.tuscany.implementation.java.introspect.IllegalPropertyException;
 import org.apache.tuscany.implementation.java.introspect.JavaClassIntrospectorExtension;
-import org.apache.tuscany.implementation.java.introspect.impl.AbstractPropertyProcessor;
 
 
 /**
@@ -119,7 +119,7 @@
     private class TestProcessor extends AbstractPropertyProcessor<Bar> {
 
         public TestProcessor() {
-            super(Bar.class);
+            super(new DefaultAssemblyFactory(), Bar.class);
         }
 
         @SuppressWarnings("unchecked")

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/AllowsPassByReferenceProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/AllowsPassByReferenceProcessorTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/AllowsPassByReferenceProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/AllowsPassByReferenceProcessorTestCase.java Sat Apr 28 16:52:22 2007
@@ -22,6 +22,7 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.introspect.impl.AllowsPassByReferenceProcessor;
 import org.osoa.sca.annotations.AllowsPassByReference;
@@ -49,7 +50,7 @@
     protected void setUp() throws Exception {
         super.setUp();
         type = new JavaImplementationDefinition();
-        processor = new AllowsPassByReferenceProcessor();
+        processor = new AllowsPassByReferenceProcessor(new DefaultAssemblyFactory());
     }
 
     @AllowsPassByReference

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ConstructorProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ConstructorProcessorTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ConstructorProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ConstructorProcessorTestCase.java Sat Apr 28 16:52:22 2007
@@ -28,7 +28,9 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Multiplicity;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.impl.Parameter;
 import org.apache.tuscany.implementation.java.introspect.impl.ConstructorProcessor;
@@ -36,6 +38,8 @@
 import org.apache.tuscany.implementation.java.introspect.impl.InvalidConstructorException;
 import org.apache.tuscany.implementation.java.introspect.impl.PropertyProcessor;
 import org.apache.tuscany.implementation.java.introspect.impl.ReferenceProcessor;
+import org.apache.tuscany.interfacedef.java.JavaFactory;
+import org.apache.tuscany.interfacedef.java.impl.DefaultJavaFactory;
 import org.apache.tuscany.interfacedef.java.introspect.DefaultJavaInterfaceIntrospector;
 import org.osoa.sca.annotations.Property;
 import org.osoa.sca.annotations.Reference;
@@ -44,7 +48,7 @@
  * @version $Rev$ $Date$
  */
 public class ConstructorProcessorTestCase extends TestCase {
-    private ConstructorProcessor processor = new ConstructorProcessor();
+    private ConstructorProcessor processor = new ConstructorProcessor(new DefaultAssemblyFactory());
 
     public void testDuplicateConstructor() throws Exception {
         JavaImplementationDefinition type = new JavaImplementationDefinition();
@@ -86,8 +90,10 @@
         Constructor<Mixed> ctor1 = Mixed.class.getConstructor(String.class, String.class, String.class);
         processor.visitConstructor(ctor1, type);
 
-        ReferenceProcessor referenceProcessor = new ReferenceProcessor(new DefaultJavaInterfaceIntrospector());
-        PropertyProcessor propertyProcessor = new PropertyProcessor();
+        AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
+        JavaFactory javaFactory = new DefaultJavaFactory();
+        ReferenceProcessor referenceProcessor = new ReferenceProcessor(assemblyFactory, javaFactory, new DefaultJavaInterfaceIntrospector(javaFactory));
+        PropertyProcessor propertyProcessor = new PropertyProcessor(assemblyFactory);
         Parameter[] parameters = type.getConstructorDefinition().getParameters();
         for (int i = 0; i < parameters.length; i++) {
             referenceProcessor.visitConstructorParameter(parameters[i], type);
@@ -158,8 +164,10 @@
                                                                     Set.class,
                                                                     String[].class);
         processor.visitConstructor(ctor1, type);
-        ReferenceProcessor referenceProcessor = new ReferenceProcessor(new DefaultJavaInterfaceIntrospector());
-        PropertyProcessor propertyProcessor = new PropertyProcessor();
+        AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
+        JavaFactory javaFactory = new DefaultJavaFactory();
+        ReferenceProcessor referenceProcessor = new ReferenceProcessor(assemblyFactory, javaFactory, new DefaultJavaInterfaceIntrospector(javaFactory));
+        PropertyProcessor propertyProcessor = new PropertyProcessor(assemblyFactory);
         Parameter[] parameters = type.getConstructorDefinition().getParameters();
         for (int i = 0; i < parameters.length; i++) {
             referenceProcessor.visitConstructorParameter(parameters[i], type);

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ContextProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ContextProcessorTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ContextProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ContextProcessorTestCase.java Sat Apr 28 16:52:22 2007
@@ -24,6 +24,7 @@
 import junit.framework.TestCase;
 
 import org.apache.tuscany.assembly.Component;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.introspect.impl.ContextProcessor;
 import org.apache.tuscany.implementation.java.introspect.impl.IllegalContextException;
@@ -145,7 +146,7 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        processor = new ContextProcessor();
+        processor = new ContextProcessor(new DefaultAssemblyFactory());
         // processor.setWorkContext(EasyMock.createNiceMock(WorkContext.class));
         composite = EasyMock.createNiceMock(Component.class);
     }

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ConversationProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ConversationProcessorTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ConversationProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ConversationProcessorTestCase.java Sat Apr 28 16:52:22 2007
@@ -23,9 +23,8 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
-import org.apache.tuscany.implementation.java.introspect.impl.ConversationProcessor;
-import org.apache.tuscany.implementation.java.introspect.impl.InvalidConversationalImplementation;
 import org.osoa.sca.annotations.ConversationAttributes;
 import org.osoa.sca.annotations.ConversationID;
 import org.osoa.sca.annotations.Scope;
@@ -34,7 +33,7 @@
  * @version $Rev$ $Date$
  */
 public class ConversationProcessorTestCase extends TestCase {
-    private ConversationProcessor processor = new ConversationProcessor();
+    private ConversationProcessor processor = new ConversationProcessor(new DefaultAssemblyFactory());
 
     public void testMaxIdleTime() throws Exception {
         JavaImplementationDefinition type =

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ConvertTimeMillisTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ConvertTimeMillisTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ConvertTimeMillisTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ConvertTimeMillisTestCase.java Sat Apr 28 16:52:22 2007
@@ -20,6 +20,7 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.implementation.java.introspect.impl.ConversationProcessor;
 
 /**
@@ -103,6 +104,10 @@
     }
 
     private class MockProcessor extends ConversationProcessor {
+        
+        public MockProcessor() {
+            super(new DefaultAssemblyFactory());
+        }
 
         @Override
         protected long convertTimeMillis(String expr) throws NumberFormatException {

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/DestroyProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/DestroyProcessorTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/DestroyProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/DestroyProcessorTestCase.java Sat Apr 28 16:52:22 2007
@@ -22,6 +22,8 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.introspect.impl.DestroyProcessor;
 import org.apache.tuscany.implementation.java.introspect.impl.DuplicateDestructorException;
@@ -32,9 +34,11 @@
  * @version $Rev$ $Date$
  */
 public class DestroyProcessorTestCase extends TestCase {
+    
+    private AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
 
     public void testDestroy() throws Exception {
-        DestroyProcessor processor = new DestroyProcessor();
+        DestroyProcessor processor = new DestroyProcessor(assemblyFactory);
         JavaImplementationDefinition type =
             new JavaImplementationDefinition();
         Method method = Foo.class.getMethod("destroy");
@@ -43,7 +47,7 @@
     }
 
     public void testBadDestroy() throws Exception {
-        DestroyProcessor processor = new DestroyProcessor();
+        DestroyProcessor processor = new DestroyProcessor(assemblyFactory);
         JavaImplementationDefinition type =
             new JavaImplementationDefinition();
         Method method = Bar.class.getMethod("badDestroy", String.class);
@@ -56,7 +60,7 @@
     }
 
     public void testTwoDestroy() throws Exception {
-        DestroyProcessor processor = new DestroyProcessor();
+        DestroyProcessor processor = new DestroyProcessor(assemblyFactory);
         JavaImplementationDefinition type =
             new JavaImplementationDefinition();
         Method method = Bar.class.getMethod("destroy");

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/EagerInitProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/EagerInitProcessorTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/EagerInitProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/EagerInitProcessorTestCase.java Sat Apr 28 16:52:22 2007
@@ -20,6 +20,8 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.introspect.IntrospectionException;
 import org.apache.tuscany.implementation.java.introspect.impl.EagerInitProcessor;
@@ -30,15 +32,17 @@
  */
 public class EagerInitProcessorTestCase extends TestCase {
 
+    private AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
+
     public void testNoLevel() throws IntrospectionException {
-        EagerInitProcessor processor = new EagerInitProcessor();
+        EagerInitProcessor processor = new EagerInitProcessor(assemblyFactory);
         JavaImplementationDefinition type =
             new JavaImplementationDefinition();
         processor.visitClass(Level.class, type);
     }
 
     public void testSubclass() throws IntrospectionException {
-        EagerInitProcessor processor = new EagerInitProcessor();
+        EagerInitProcessor processor = new EagerInitProcessor(assemblyFactory);
         JavaImplementationDefinition type =
             new JavaImplementationDefinition();
         processor.visitClass(SubClass.class, type);

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicAndPropertyTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicAndPropertyTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicAndPropertyTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicAndPropertyTestCase.java Sat Apr 28 16:52:22 2007
@@ -22,10 +22,11 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.ConstructorDefinition;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
-import org.apache.tuscany.implementation.java.introspect.impl.HeuristicPojoProcessor;
-import org.apache.tuscany.implementation.java.introspect.impl.PropertyProcessor;
+import org.apache.tuscany.interfacedef.java.impl.DefaultJavaFactory;
 import org.apache.tuscany.interfacedef.java.introspect.DefaultJavaInterfaceIntrospector;
 import org.osoa.sca.annotations.Property;
 
@@ -36,6 +37,8 @@
 
     private PropertyProcessor propertyProcessor;
     private HeuristicPojoProcessor heuristicProcessor;
+    private AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
+
 
     /**
      * Verifies the property and heuristic processors don't collide
@@ -53,9 +56,9 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        DefaultJavaInterfaceIntrospector introspector = new DefaultJavaInterfaceIntrospector();
-        propertyProcessor = new PropertyProcessor();
-        heuristicProcessor = new HeuristicPojoProcessor(introspector);
+        DefaultJavaInterfaceIntrospector introspector = new DefaultJavaInterfaceIntrospector(new DefaultJavaFactory());
+        propertyProcessor = new PropertyProcessor(assemblyFactory);
+        heuristicProcessor = new HeuristicPojoProcessor(assemblyFactory, new DefaultJavaFactory(), introspector);
     }
 
     public static class Foo {

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicConstructorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicConstructorTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicConstructorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicConstructorTestCase.java Sat Apr 28 16:52:22 2007
@@ -22,12 +22,16 @@
 
 import java.lang.reflect.Constructor;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaElement;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.introspect.IntrospectionException;
 import org.apache.tuscany.implementation.java.introspect.impl.AmbiguousConstructorException;
 import org.apache.tuscany.implementation.java.introspect.impl.HeuristicPojoProcessor;
 import org.apache.tuscany.implementation.java.introspect.impl.NoConstructorException;
+import org.apache.tuscany.interfacedef.java.JavaFactory;
+import org.apache.tuscany.interfacedef.java.impl.DefaultJavaFactory;
 import org.apache.tuscany.interfacedef.java.introspect.DefaultJavaInterfaceIntrospector;
 import org.osoa.sca.annotations.Property;
 import org.osoa.sca.annotations.Reference;
@@ -38,11 +42,15 @@
  */
 public class HeuristicConstructorTestCase extends AbstractProcessorTest {
 
+    private AssemblyFactory factory;
+    private JavaFactory javaFactory;
     private HeuristicPojoProcessor processor;
 
     public HeuristicConstructorTestCase() {
-        DefaultJavaInterfaceIntrospector introspector = new DefaultJavaInterfaceIntrospector();
-        processor = new HeuristicPojoProcessor(introspector);
+        factory = new DefaultAssemblyFactory();
+        javaFactory = new DefaultJavaFactory();
+        DefaultJavaInterfaceIntrospector introspector = new DefaultJavaInterfaceIntrospector(javaFactory);
+        processor = new HeuristicPojoProcessor(factory, javaFactory, introspector);
     }
 
     private <T> void visitEnd(Class<T> clazz, JavaImplementationDefinition type) throws IntrospectionException {
@@ -96,7 +104,7 @@
         JavaElement element = new JavaElement("foo", String.class, null);
         type.getPropertyMembers().put("foo", element);
 
-        org.apache.tuscany.assembly.Reference ref = ModelHelper.createReference("ref", Foo1.class);
+        org.apache.tuscany.assembly.Reference ref = ModelHelper.createReference(factory, javaFactory, "ref", Foo1.class);
         type.getReferences().add(ref);
         type.getReferenceMembers().put("ref", new JavaElement("ref", Foo1.class, null));
         visitEnd(Foo2.class, type);
@@ -118,10 +126,10 @@
 
     public void testSingleConstructorAmbiguousRef() throws Exception {
         JavaImplementationDefinition type = new JavaImplementationDefinition();
-        org.apache.tuscany.assembly.Reference ref = ModelHelper.createReference("ref", Foo1.class);
+        org.apache.tuscany.assembly.Reference ref = ModelHelper.createReference(factory, javaFactory, "ref", Foo1.class);
         type.getReferences().add(ref);
         type.getReferenceMembers().put("ref", new JavaElement("ref", Foo1.class, null));
-        org.apache.tuscany.assembly.Reference ref2 = ModelHelper.createReference("ref2", Foo1.class);
+        org.apache.tuscany.assembly.Reference ref2 = ModelHelper.createReference(factory, javaFactory, "ref2", Foo1.class);
         type.getReferences().add(ref2);
         type.getReferenceMembers().put("ref2", new JavaElement("ref2", Foo1.class, null));
         try {

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicPojoProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicPojoProcessorTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicPojoProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicPojoProcessorTestCase.java Sat Apr 28 16:52:22 2007
@@ -24,10 +24,12 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 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.introspect.IntrospectionException;
+import org.apache.tuscany.interfacedef.java.impl.DefaultJavaFactory;
 import org.apache.tuscany.interfacedef.java.introspect.DefaultJavaInterfaceIntrospector;
 import org.apache.tuscany.interfacedef.util.JavaXMLMapper;
 import org.osoa.sca.annotations.Property;
@@ -46,8 +48,8 @@
     private org.apache.tuscany.implementation.java.introspect.impl.HeuristicPojoProcessor processor;
 
     public HeuristicPojoProcessorTestCase() {
-        DefaultJavaInterfaceIntrospector introspector = new DefaultJavaInterfaceIntrospector();
-        processor = new HeuristicPojoProcessor(introspector);
+        DefaultJavaInterfaceIntrospector introspector = new DefaultJavaInterfaceIntrospector(new DefaultJavaFactory());
+        processor = new HeuristicPojoProcessor(new DefaultAssemblyFactory(), new DefaultJavaFactory(), introspector);
     }
 
     private <T> void visitEnd(Class<T> clazz, JavaImplementationDefinition type) throws IntrospectionException {

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeutisticExtensibleConstructorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeutisticExtensibleConstructorTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeutisticExtensibleConstructorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/HeutisticExtensibleConstructorTestCase.java Sat Apr 28 16:52:22 2007
@@ -21,10 +21,12 @@
 import java.lang.reflect.Constructor;
 
 import org.apache.tuscany.assembly.Property;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 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.introspect.IntrospectionException;
+import org.apache.tuscany.interfacedef.java.impl.DefaultJavaFactory;
 import org.apache.tuscany.interfacedef.java.introspect.DefaultJavaInterfaceIntrospector;
 
 /**
@@ -39,8 +41,8 @@
     private org.apache.tuscany.implementation.java.introspect.impl.HeuristicPojoProcessor processor;
 
     public HeutisticExtensibleConstructorTestCase() {
-        DefaultJavaInterfaceIntrospector introspector = new DefaultJavaInterfaceIntrospector();
-        processor = new HeuristicPojoProcessor(introspector);
+        DefaultJavaInterfaceIntrospector introspector = new DefaultJavaInterfaceIntrospector(new DefaultJavaFactory());
+        processor = new HeuristicPojoProcessor(new DefaultAssemblyFactory(), new DefaultJavaFactory(), introspector);
     }
 
     private <T> void visitEnd(Class<T> clazz, JavaImplementationDefinition type) throws IntrospectionException {

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/InitProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/InitProcessorTestCase.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/InitProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/InitProcessorTestCase.java Sat Apr 28 16:52:22 2007
@@ -22,6 +22,7 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.implementation.java.introspect.impl.DuplicateInitException;
 import org.apache.tuscany.implementation.java.introspect.impl.IllegalInitException;
@@ -34,7 +35,7 @@
 public class InitProcessorTestCase extends TestCase {
 
     public void testInit() throws Exception {
-        InitProcessor processor = new InitProcessor();
+        InitProcessor processor = new InitProcessor(new DefaultAssemblyFactory());
         JavaImplementationDefinition type =
             new JavaImplementationDefinition();
         Method method = InitProcessorTestCase.Foo.class.getMethod("init");
@@ -43,7 +44,7 @@
     }
 
     public void testBadInit() throws Exception {
-        InitProcessor processor = new InitProcessor();
+        InitProcessor processor = new InitProcessor(new DefaultAssemblyFactory());
         JavaImplementationDefinition type =
             new JavaImplementationDefinition();
         Method method = InitProcessorTestCase.Bar.class.getMethod("badInit", String.class);
@@ -56,7 +57,7 @@
     }
 
     public void testTwoInit() throws Exception {
-        InitProcessor processor = new InitProcessor();
+        InitProcessor processor = new InitProcessor(new DefaultAssemblyFactory());
         JavaImplementationDefinition type =
             new JavaImplementationDefinition();
         Method method = InitProcessorTestCase.Bar.class.getMethod("init");

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ModelHelper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ModelHelper.java?view=diff&rev=533445&r1=533444&r2=533445
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ModelHelper.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/introspect/impl/ModelHelper.java Sat Apr 28 16:52:22 2007
@@ -25,19 +25,16 @@
 import org.apache.tuscany.assembly.Property;
 import org.apache.tuscany.assembly.Reference;
 import org.apache.tuscany.assembly.Service;
-import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationDefinition;
 import org.apache.tuscany.interfacedef.Interface;
+import org.apache.tuscany.interfacedef.java.JavaFactory;
 import org.apache.tuscany.interfacedef.java.JavaInterface;
 import org.apache.tuscany.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.interfacedef.java.impl.JavaInterfaceContractImpl;
-import org.apache.tuscany.interfacedef.java.impl.JavaInterfaceImpl;
 
 /**
  * @version $Rev$ $Date$
  */
 public class ModelHelper {
-    private final static AssemblyFactory factory = new DefaultAssemblyFactory();
 
     public static Property getProperty(JavaImplementationDefinition type, String name) {
         for (Property prop : type.getProperties()) {
@@ -75,23 +72,25 @@
         }
     }
 
-    public static ComponentService createService(Class<?> type) {
+    public static ComponentService createService(AssemblyFactory factory,
+                                                 JavaFactory javaFactory, Class<?> type) {
         org.apache.tuscany.assembly.ComponentService ref = factory.createComponentService();
         ref.setName(type.getSimpleName());
-        JavaInterface i = new JavaInterfaceImpl();
+        JavaInterface i = javaFactory.createJavaInterface();
         i.setJavaClass(type);
-        JavaInterfaceContract ic = new JavaInterfaceContractImpl();
+        JavaInterfaceContract ic = javaFactory.createJavaInterfaceContract();
         ic.setInterface(i);
         ref.setInterfaceContract(ic);
         return ref;
     }
 
-    public static Reference createReference(String name, Class<?> type) {
+    public static Reference createReference(AssemblyFactory factory,
+                                            JavaFactory javaFactory, String name, Class<?> type) {
         org.apache.tuscany.assembly.Reference ref = factory.createReference();
         ref.setName(name);
-        JavaInterface i = new JavaInterfaceImpl();
+        JavaInterface i = javaFactory.createJavaInterface();
         i.setJavaClass(type);
-        JavaInterfaceContract ic = new JavaInterfaceContractImpl();
+        JavaInterfaceContract ic = javaFactory.createJavaInterfaceContract();
         ic.setInterface(i);
         ref.setInterfaceContract(ic);
         return ref;



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


Mime
View raw message