tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r826907 [2/2] - in /tuscany/java/sca/modules: assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ assembly/src/main/java/org/apache/tuscany/sca/assembly/ assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ extensibility...
Date Tue, 20 Oct 2009 00:17:16 GMT
Modified: tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ScopeProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ScopeProcessor.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ScopeProcessor.java
(original)
+++ tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ScopeProcessor.java
Tue Oct 20 00:17:14 2009
@@ -19,6 +19,7 @@
 package org.apache.tuscany.sca.implementation.java.introspect.impl;
 
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.implementation.java.IntrospectionException;
 import org.apache.tuscany.sca.implementation.java.JavaImplementation;
 import org.apache.tuscany.sca.implementation.java.JavaScopeImpl;
@@ -34,6 +35,10 @@
     public ScopeProcessor(AssemblyFactory factory) {
         super(factory);
     }
+    
+    public ScopeProcessor(ExtensionPointRegistry registry) {
+        super(registry);
+    }    
 
     @Override
     public <T> void visitClass(Class<T> clazz,

Modified: tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
(original)
+++ tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
Tue Oct 20 00:17:14 2009
@@ -28,12 +28,12 @@
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Set;
-import java.util.logging.Logger;
 
 import javax.jws.WebService;
 
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
 import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.implementation.java.IntrospectionException;
 import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
 import org.apache.tuscany.sca.implementation.java.JavaImplementation;
@@ -55,12 +55,14 @@
  * @version $Rev$ $Date$
  */
 public class ServiceProcessor extends BaseJavaClassVisitor {
-    private static final Logger logger = Logger.getLogger(ServiceProcessor.class.getName());
-    private JavaInterfaceFactory javaFactory;
     
     public ServiceProcessor(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory)
{
         super(assemblyFactory);
-        this.javaFactory = javaFactory;
+        this.javaInterfaceFactory = javaFactory;
+    }
+    
+    public ServiceProcessor(ExtensionPointRegistry registry) {
+        super(registry);
     }
 
     @Override
@@ -180,7 +182,7 @@
 
     public Service createService(Class<?> interfaze, String name) throws InvalidInterfaceException
{
         Service service = assemblyFactory.createService();
-        JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
+        JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
         service.setInterfaceContract(interfaceContract);
 
         if (name == null) {
@@ -189,10 +191,10 @@
             service.setName(name);
         }
 
-        JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
+        JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(interfaze);
         service.getInterfaceContract().setInterface(callInterface);
         if (callInterface.getCallbackClass() != null) {
-            JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
+            JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callInterface.getCallbackClass());
             service.getInterfaceContract().setCallbackInterface(callbackInterface);
         }
         return service;

Added: tuscany/java/sca/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor?rev=826907&view=auto
==============================================================================
--- tuscany/java/sca/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor
(added)
+++ tuscany/java/sca/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor
Tue Oct 20 00:17:14 2009
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation 
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# 
+# NOTE: The ranking attribute is important for the JavaClassVistors 
+# Some visitors need to be called after the others 
+org.apache.tuscany.sca.implementation.java.introspect.impl.ConstructorProcessor;ranking=200
+org.apache.tuscany.sca.implementation.java.introspect.impl.AllowsPassByReferenceProcessor;ranking=190
+org.apache.tuscany.sca.implementation.java.introspect.impl.ComponentNameProcessor;ranking=180
+org.apache.tuscany.sca.implementation.java.introspect.impl.ContextProcessor;ranking=170
+org.apache.tuscany.sca.implementation.java.introspect.impl.DestroyProcessor;ranking=160
+org.apache.tuscany.sca.implementation.java.introspect.impl.EagerInitProcessor;ranking=150
+org.apache.tuscany.sca.implementation.java.introspect.impl.InitProcessor;ranking=140
+org.apache.tuscany.sca.implementation.java.introspect.impl.PropertyProcessor;ranking=130
+org.apache.tuscany.sca.implementation.java.introspect.impl.ReferenceProcessor;ranking=120
+org.apache.tuscany.sca.implementation.java.introspect.impl.ResourceProcessor;ranking=110
+org.apache.tuscany.sca.implementation.java.introspect.impl.ScopeProcessor;ranking=100
+org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceProcessor;ranking=90
+org.apache.tuscany.sca.implementation.java.introspect.impl.HeuristicPojoProcessor;ranking=80
+org.apache.tuscany.sca.implementation.java.introspect.impl.PolicyProcessor;ranking=70
\ No newline at end of file

Modified: tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractProcessorTest.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractProcessorTest.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractProcessorTest.java
(original)
+++ tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractProcessorTest.java
Tue Oct 20 00:17:14 2009
@@ -51,11 +51,11 @@
         factory = new DefaultAssemblyFactory(registry);
         javaFactory = new DefaultJavaInterfaceFactory(registry);
         referenceProcessor = new ReferenceProcessor(factory, javaFactory);
-        propertyProcessor = new PropertyProcessor(factory);
+        propertyProcessor = new PropertyProcessor(registry);
         resourceProcessor = new ResourceProcessor(factory);
         constructorProcessor = new ConstructorProcessor(factory);
         referenceProcessor = new ReferenceProcessor(factory, javaFactory);
-        propertyProcessor = new PropertyProcessor(factory);
+        propertyProcessor = new PropertyProcessor(registry);
     }
 
     protected <T> void visitConstructor(Constructor<T> constructor,

Modified: tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorProcessorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorProcessorTestCase.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorProcessorTestCase.java
(original)
+++ tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorProcessorTestCase.java
Tue Oct 20 00:17:14 2009
@@ -103,7 +103,7 @@
         AssemblyFactory assemblyFactory = new DefaultAssemblyFactory(registry);
         JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory(registry);
         ReferenceProcessor referenceProcessor = new ReferenceProcessor(assemblyFactory, javaFactory);
-        PropertyProcessor propertyProcessor = new PropertyProcessor(assemblyFactory);
+        PropertyProcessor propertyProcessor = new PropertyProcessor(registry);
         JavaParameterImpl[] parameters = type.getConstructor().getParameters();
         for (int i = 0; i < parameters.length; i++) {
             referenceProcessor.visitConstructorParameter(parameters[i], type);
@@ -179,7 +179,7 @@
         AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
         JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory(registry);
         ReferenceProcessor referenceProcessor = new ReferenceProcessor(assemblyFactory, javaFactory);
-        PropertyProcessor propertyProcessor = new PropertyProcessor(assemblyFactory);
+        PropertyProcessor propertyProcessor = new PropertyProcessor(registry);
         JavaParameterImpl[] parameters = type.getConstructor().getParameters();
         for (int i = 0; i < parameters.length; i++) {
             referenceProcessor.visitConstructorParameter(parameters[i], type);

Modified: tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicAndPropertyTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicAndPropertyTestCase.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicAndPropertyTestCase.java
(original)
+++ tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicAndPropertyTestCase.java
Tue Oct 20 00:17:14 2009
@@ -22,15 +22,12 @@
 
 import java.lang.reflect.Constructor;
 
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
 import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
 import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
 import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
 import org.apache.tuscany.sca.implementation.java.JavaImplementation;
 import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
 import org.junit.Before;
 import org.junit.Test;
 import org.oasisopen.sca.annotation.Property;
@@ -42,7 +39,6 @@
 
     private PropertyProcessor propertyProcessor;
     private HeuristicPojoProcessor heuristicProcessor;
-    private AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
     private JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
 
     /**
@@ -63,8 +59,8 @@
     @Before
     public void setUp() throws Exception {
         ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
-        propertyProcessor = new PropertyProcessor(assemblyFactory);
-        heuristicProcessor = new HeuristicPojoProcessor(assemblyFactory, new DefaultJavaInterfaceFactory(registry));
+        propertyProcessor = new PropertyProcessor(registry);
+        heuristicProcessor = new HeuristicPojoProcessor(registry);
     }
 
     public static class Foo {

Modified: tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCase.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCase.java
(original)
+++ tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCase.java
Tue Oct 20 00:17:14 2009
@@ -35,7 +35,6 @@
 import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
 import org.apache.tuscany.sca.interfacedef.java.impl.PolicyJavaInterfaceVisitor;
-import org.apache.tuscany.sca.policy.DefaultPolicyFactory;
 import org.apache.tuscany.sca.policy.Intent;
 import org.apache.tuscany.sca.policy.PolicySubject;
 import org.junit.Before;
@@ -246,7 +245,7 @@
     public void setUp() throws Exception {
         ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
         serviceProcessor = new ServiceProcessor(new DefaultAssemblyFactory(), new DefaultJavaInterfaceFactory(registry));
-        policyProcessor = new PolicyProcessor(new DefaultAssemblyFactory(), new DefaultPolicyFactory());
+        policyProcessor = new PolicyProcessor(registry);
         visitor = new PolicyJavaInterfaceVisitor(registry);
         JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
         type = javaImplementationFactory.createJavaImplementation();

Modified: tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PropertyProcessorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PropertyProcessorTestCase.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PropertyProcessorTestCase.java
(original)
+++ tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PropertyProcessorTestCase.java
Tue Oct 20 00:17:14 2009
@@ -28,7 +28,7 @@
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
 import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
 import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
 import org.apache.tuscany.sca.implementation.java.JavaImplementation;
@@ -50,7 +50,7 @@
     public void setUp() throws Exception {
         JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
         type = javaImplementationFactory.createJavaImplementation();
-        processor = new PropertyProcessor(new DefaultAssemblyFactory());
+        processor = new PropertyProcessor(new DefaultExtensionPointRegistry());
     }
 
     @Test

Modified: tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/TestAbstractPropertyProcessorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/TestAbstractPropertyProcessorTestCase.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/TestAbstractPropertyProcessorTestCase.java
(original)
+++ tuscany/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/TestAbstractPropertyProcessorTestCase.java
Tue Oct 20 00:17:14 2009
@@ -29,8 +29,8 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
 import org.apache.tuscany.sca.assembly.Property;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
 import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
 import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
 import org.apache.tuscany.sca.implementation.java.JavaImplementation;
@@ -129,7 +129,7 @@
     private class TestProcessor extends AbstractPropertyProcessor<Bar> {
 
         public TestProcessor() {
-            super(new DefaultAssemblyFactory(), Bar.class);
+            super(new DefaultExtensionPointRegistry(), Bar.class);
         }
 
         @Override

Modified: tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/DefaultOSGiImplementationFactory.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/DefaultOSGiImplementationFactory.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/DefaultOSGiImplementationFactory.java
(original)
+++ tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/DefaultOSGiImplementationFactory.java
Tue Oct 20 00:17:14 2009
@@ -19,7 +19,7 @@
 
 package org.apache.tuscany.sca.implementation.osgi;
 
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.implementation.osgi.impl.OSGiImplementationFactoryImpl;
 
 /**
@@ -27,8 +27,8 @@
  */
 public class DefaultOSGiImplementationFactory extends OSGiImplementationFactoryImpl {
 
-    public DefaultOSGiImplementationFactory(FactoryExtensionPoint factoryExtensionPoint)
{
-        super(factoryExtensionPoint);
+    public DefaultOSGiImplementationFactory(ExtensionPointRegistry registry) {
+        super(registry);
     }
 
 }

Modified: tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/OSGiImplementationFactoryImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/OSGiImplementationFactoryImpl.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/OSGiImplementationFactoryImpl.java
(original)
+++ tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/OSGiImplementationFactoryImpl.java
Tue Oct 20 00:17:14 2009
@@ -19,7 +19,7 @@
 
 package org.apache.tuscany.sca.implementation.osgi.impl;
 
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.implementation.osgi.OSGiImplementation;
 import org.apache.tuscany.sca.implementation.osgi.OSGiImplementationFactory;
 import org.apache.tuscany.sca.implementation.osgi.OSGiProperty;
@@ -28,15 +28,12 @@
  * 
  */
 public class OSGiImplementationFactoryImpl implements OSGiImplementationFactory {
-    private final FactoryExtensionPoint factoryExtensionPoint;
-
-    public OSGiImplementationFactoryImpl(FactoryExtensionPoint factoryExtensionPoint) {
+    public OSGiImplementationFactoryImpl(ExtensionPointRegistry registry) {
         super();
-        this.factoryExtensionPoint = factoryExtensionPoint;
     }
 
     public OSGiImplementation createOSGiImplementation() {
-        return new OSGiImplementationImpl(factoryExtensionPoint);
+        return new OSGiImplementationImpl();
     }
 
     public OSGiProperty createOSGiProperty() {

Modified: tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/OSGiImplementationImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/OSGiImplementationImpl.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/OSGiImplementationImpl.java
(original)
+++ tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/OSGiImplementationImpl.java
Tue Oct 20 00:17:14 2009
@@ -19,7 +19,6 @@
 package org.apache.tuscany.sca.implementation.osgi.impl;
 
 import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
 import org.apache.tuscany.sca.implementation.osgi.OSGiImplementation;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
@@ -37,18 +36,14 @@
     private String bundleVersion;
     private Bundle osgiBundle;
 
-    private FactoryExtensionPoint modelFactories;
-
-    protected OSGiImplementationImpl(FactoryExtensionPoint modelFactories) {
+    protected OSGiImplementationImpl() {
         super(TYPE);
-        this.modelFactories = modelFactories;
     }
 
-    public OSGiImplementationImpl(FactoryExtensionPoint modelFactories, String bundleSymbolicName,
String bundleVersion) {
+    public OSGiImplementationImpl(String bundleSymbolicName, String bundleVersion) {
         super(TYPE);
         this.bundleSymbolicName = bundleSymbolicName;
         this.bundleVersion = bundleVersion;
-        this.modelFactories = modelFactories;
     }
 
     public String getBundleSymbolicName() {
@@ -59,10 +54,6 @@
         return bundleVersion;
     }
 
-    public FactoryExtensionPoint getModelFactories() {
-        return modelFactories;
-    }
-
     /**
      * Since OSGi implementation annotations may not be processed until much later, leave
it to
      * the OSGi invoker to decide whether pass-by-reference is allowed.

Modified: tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanIntrospector.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanIntrospector.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanIntrospector.java
(original)
+++ tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanIntrospector.java
Tue Oct 20 00:17:14 2009
@@ -20,29 +20,14 @@
 
 import java.util.List;
 
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
 import org.apache.tuscany.sca.assembly.ComponentType;
 import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
 import org.apache.tuscany.sca.implementation.java.IntrospectionException;
 import org.apache.tuscany.sca.implementation.java.JavaImplementation;
 import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ComponentNameProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ConstructorProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ContextProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.DestroyProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.EagerInitProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.InitProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.PolicyProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.PropertyProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ReferenceProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ResourceProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceProcessor;
 import org.apache.tuscany.sca.implementation.spring.SpringConstructorArgElement;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.policy.PolicyFactory;
 
 /**
  * Provides introspection functions for Spring beans
@@ -62,32 +47,11 @@
      * @param javaFactory The Java Interface Factory to use
      * @param policyFactory The Policy Factory to use.
      */
-    public SpringBeanIntrospector(AssemblyFactory assemblyFactory,
-                                  JavaInterfaceFactory javaFactory,
-                                  PolicyFactory policyFactory,
+    public SpringBeanIntrospector(ExtensionPointRegistry registry,
                                   List<SpringConstructorArgElement> conArgs) {
 
-        javaImplementationFactory = new DefaultJavaImplementationFactory();
-        
-        // Create the list of class visitors
-        BaseJavaClassVisitor[] extensions =
-            new BaseJavaClassVisitor[] {
-                                        new ConstructorProcessor(assemblyFactory),
-                                        new ComponentNameProcessor(assemblyFactory),
-                                        new ContextProcessor(assemblyFactory),
-                                        new DestroyProcessor(assemblyFactory),
-                                        new EagerInitProcessor(assemblyFactory),
-                                        new InitProcessor(assemblyFactory),
-                                        new PropertyProcessor(assemblyFactory),
-                                        new ReferenceProcessor(assemblyFactory, javaFactory),
-                                        new ResourceProcessor(assemblyFactory),
-                                        new ServiceProcessor(assemblyFactory, javaFactory),
-                                        new SpringBeanPojoProcessor(assemblyFactory, javaFactory,
conArgs),
-                                        new PolicyProcessor(assemblyFactory, policyFactory)};
-        for (JavaClassVisitor extension : extensions) {
-            javaImplementationFactory.addClassVisitor(extension);
-        }
-
+        FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
+        javaImplementationFactory = factories.getFactory(JavaImplementationFactory.class);
     } // end constructor 
 
     /**

Modified: tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanPojoProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanPojoProcessor.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanPojoProcessor.java
(original)
+++ tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanPojoProcessor.java
Tue Oct 20 00:17:14 2009
@@ -43,6 +43,7 @@
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
 import org.apache.tuscany.sca.assembly.Contract;
 import org.apache.tuscany.sca.assembly.Multiplicity;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.implementation.java.IntrospectionException;
 import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
 import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
@@ -80,14 +81,17 @@
  * @version $Rev$ $Date$
  */
 public class SpringBeanPojoProcessor extends BaseJavaClassVisitor {
-    private JavaInterfaceFactory javaFactory;
     private List<SpringConstructorArgElement> conArgs;
 
     public SpringBeanPojoProcessor(AssemblyFactory assemblyFactory, JavaInterfaceFactory
javaFactory, List<SpringConstructorArgElement> conArgs) {
         super(assemblyFactory);
-        this.javaFactory = javaFactory;
+        this.javaInterfaceFactory = javaFactory;
         this.conArgs = conArgs;
     }
+    
+    public SpringBeanPojoProcessor(ExtensionPointRegistry registry) {
+        super(registry);
+    }
 
     @Override
     public <T> void visitEnd(Class<T> clazz, JavaImplementation type) throws
IntrospectionException {
@@ -582,13 +586,13 @@
         throws IntrospectionException {
         org.apache.tuscany.sca.assembly.Reference reference = assemblyFactory.createReference();
         reference.setName(name);
-        JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
+        JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
         reference.setInterfaceContract(interfaceContract);
         try {
-            JavaInterface callInterface = javaFactory.createJavaInterface(paramType);
+            JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(paramType);
             reference.getInterfaceContract().setInterface(callInterface);
             if (callInterface.getCallbackClass() != null) {
-                JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
+                JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callInterface.getCallbackClass());
                 reference.getInterfaceContract().setCallbackInterface(callbackInterface);
             }
             reference.setMultiplicity(Multiplicity.ZERO_ONE);
@@ -609,13 +613,13 @@
         org.apache.tuscany.sca.assembly.Service service = assemblyFactory.createService();
         service.setName(interfaze.getSimpleName());
 
-        JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
+        JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
         service.setInterfaceContract(interfaceContract);
 
-        JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
+        JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(interfaze);
         service.getInterfaceContract().setInterface(callInterface);
         if (callInterface.getCallbackClass() != null) {
-            JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
+            JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callInterface.getCallbackClass());
             service.getInterfaceContract().setCallbackInterface(callbackInterface);
         }
 
@@ -631,7 +635,7 @@
             Class<?> callbackClass = callback.value();
             JavaInterface javaInterface;
             try {
-                javaInterface = javaFactory.createJavaInterface(callbackClass);
+                javaInterface = javaInterfaceFactory.createJavaInterface(callbackClass);
                 contract.getInterfaceContract().setCallbackInterface(javaInterface);
             } catch (InvalidInterfaceException e) {
                 throw new InvalidServiceTypeException("Invalid callback interface "+callbackClass,
interfaze);

Modified: tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
(original)
+++ tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
Tue Oct 20 00:17:14 2009
@@ -59,6 +59,7 @@
 import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
 import org.apache.tuscany.sca.contribution.resolver.ClassReference;
 import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.core.FactoryExtensionPoint;
 import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
 import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
@@ -89,7 +90,7 @@
  * @version $Rev$ $Date$
  */
 public class SpringXMLComponentTypeLoader {
-
+    private ExtensionPointRegistry registry;
     private XMLInputFactory xmlInputFactory;
     private ContributionFactory contributionFactory;
     private AssemblyFactory assemblyFactory;
@@ -99,15 +100,14 @@
     private Monitor monitor;
     private SpringBeanIntrospector beanIntrospector;
 
-    public SpringXMLComponentTypeLoader(FactoryExtensionPoint factories,
-                                        AssemblyFactory assemblyFactory,
-                                        JavaInterfaceFactory javaFactory,
-                                        PolicyFactory policyFactory,
+    public SpringXMLComponentTypeLoader(ExtensionPointRegistry registry,
                                         Monitor monitor) {
         super();
-        this.assemblyFactory = assemblyFactory;
-        this.javaFactory = javaFactory;
-        this.policyFactory = policyFactory;
+        this.registry = registry;
+        FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
+        this.assemblyFactory = factories.getFactory(AssemblyFactory.class);
+        this.javaFactory = factories.getFactory(JavaInterfaceFactory.class);
+        this.policyFactory = factories.getFactory(PolicyFactory.class);
         this.policyProcessor = new PolicySubjectProcessor(policyFactory);
         this.contributionFactory = factories.getFactory(ContributionFactory.class);
         this.xmlInputFactory = factories.getFactory(XMLInputFactory.class);
@@ -653,7 +653,7 @@
                     Class<?> beanClass = resolveClass(resolver, beanElement.getClassName(),
context);
                     // Introspect the bean
                     beanIntrospector =
-                        new SpringBeanIntrospector(assemblyFactory, javaFactory, policyFactory,
beanElement.getCustructorArgs());
+                        new SpringBeanIntrospector(registry, beanElement.getCustructorArgs());
                     ComponentType beanComponentType = assemblyFactory.createComponentType();
                     javaImplementation = beanIntrospector.introspectBean(beanClass, beanComponentType);
                     // Set the service name as bean name
@@ -680,7 +680,7 @@
                 Class<?> beanClass = resolveClass(resolver, beanElement.getClassName(),
context);
                 // Introspect the bean
                 beanIntrospector =
-                    new SpringBeanIntrospector(assemblyFactory, javaFactory, policyFactory,
beanElement.getCustructorArgs());
+                    new SpringBeanIntrospector(registry, beanElement.getCustructorArgs());
                 ComponentType beanComponentType = assemblyFactory.createComponentType();
                 javaImplementation = beanIntrospector.introspectBean(beanClass, beanComponentType);
                 Map<String, JavaElementImpl> propertyMap = javaImplementation.getPropertyMembers();

Modified: tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java
(original)
+++ tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java
Tue Oct 20 00:17:14 2009
@@ -36,14 +36,13 @@
 import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.core.FactoryExtensionPoint;
 import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
 import org.apache.tuscany.sca.implementation.spring.introspect.SpringXMLComponentTypeLoader;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
 import org.apache.tuscany.sca.monitor.Monitor;
 import org.apache.tuscany.sca.monitor.Problem;
 import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.policy.PolicyFactory;
 
 /**
  * SpringArtifactProcessor is responsible for processing the XML of an <implementation.spring.../>
@@ -58,20 +57,18 @@
     private static final QName IMPLEMENTATION_SPRING_QNAME = new QName(Constants.SCA11_NS,
IMPLEMENTATION_SPRING);
     private static final String MSG_LOCATION_MISSING = "Reading implementation.spring - location
attribute missing";
 
+    private ExtensionPointRegistry registry;
     private AssemblyFactory assemblyFactory;
-    private JavaInterfaceFactory javaFactory;
-    private PolicyFactory policyFactory;
     private PolicySubjectProcessor policyProcessor;
     
 
     private FactoryExtensionPoint factories;
 
-    public SpringImplementationProcessor(FactoryExtensionPoint modelFactories) {
-        this.factories = modelFactories;
-        this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
-        this.javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
-        this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
-        this.policyProcessor = new PolicySubjectProcessor(policyFactory);
+    public SpringImplementationProcessor(ExtensionPointRegistry registry) {
+        this.registry = registry;
+        this.factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
+        this.assemblyFactory = factories.getFactory(AssemblyFactory.class);
+        this.policyProcessor = new PolicySubjectProcessor(registry);
     }
 
     /**
@@ -196,7 +193,7 @@
     	Monitor monitor = context.getMonitor();
         /* Load the Spring component type by reading the Spring application context */
         SpringXMLComponentTypeLoader springLoader =
-            new SpringXMLComponentTypeLoader(factories, assemblyFactory, javaFactory, policyFactory,
monitor);
+            new SpringXMLComponentTypeLoader(registry, monitor);
         try {
             // Load the Spring Implementation information from its application context file...
             springLoader.load(springImplementation, resolver, context);

Modified: tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterfaceFactory.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterfaceFactory.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterfaceFactory.java
(original)
+++ tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterfaceFactory.java
Tue Oct 20 00:17:14 2009
@@ -18,6 +18,7 @@
  */
 package org.apache.tuscany.sca.interfacedef.java;
 
+import java.lang.reflect.Method;
 import java.util.List;
 
 import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
@@ -53,6 +54,13 @@
     void createJavaInterface(JavaInterface javaInterface, Class<?> interfaceClass)
throws InvalidInterfaceException;
     
     /**
+     * Create a JavaOperation
+     * @param method
+     * @return
+     */
+    JavaOperation createJavaOperation(Method method);
+    
+    /**
      * Creates a new Java interface contract.
      * 
      * @return

Modified: tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceFactoryImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceFactoryImpl.java?rev=826907&r1=826906&r2=826907&view=diff
==============================================================================
--- tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceFactoryImpl.java
(original)
+++ tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceFactoryImpl.java
Tue Oct 20 00:17:14 2009
@@ -18,6 +18,7 @@
  */
 package org.apache.tuscany.sca.interfacedef.java.impl;
 
+import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -28,6 +29,7 @@
 import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
 import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor;
 
 /**
@@ -81,4 +83,11 @@
     public List<JavaInterfaceVisitor> getInterfaceVisitors() {
         return visitors;
     }
+
+    public JavaOperation createJavaOperation(Method method) {
+        JavaOperation op =  new JavaOperationImpl();
+        op.setJavaMethod(method);
+        op.setName(method.getName());
+        return op;
+    }
 }



Mime
View raw message