diff options
Diffstat (limited to 'branches/sca-equinox/modules/implementation-spring')
3 files changed, 11 insertions, 45 deletions
diff --git a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProcessor.java b/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProcessor.java index c886c0390c..0ce9596ad4 100644 --- a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProcessor.java +++ b/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProcessor.java @@ -37,6 +37,7 @@ import org.apache.tuscany.sca.contribution.resolver.ModelResolver; import org.apache.tuscany.sca.contribution.service.ContributionReadException; import org.apache.tuscany.sca.contribution.service.ContributionResolveException; import org.apache.tuscany.sca.contribution.service.ContributionWriteException; +import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory; import org.apache.tuscany.sca.implementation.spring.xml.SpringXMLComponentTypeLoader; import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; import org.apache.tuscany.sca.monitor.Monitor; @@ -59,6 +60,7 @@ public class SpringImplementationProcessor implements StAXArtifactProcessor<Spri private AssemblyFactory assemblyFactory; private JavaInterfaceFactory javaFactory; + private JavaImplementationFactory javaImplementationFactory; private PolicyFactory policyFactory; private PolicyAttachPointProcessor policyProcessor; private Monitor monitor; @@ -66,6 +68,7 @@ public class SpringImplementationProcessor implements StAXArtifactProcessor<Spri public SpringImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) { this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class); this.javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class); + this.javaImplementationFactory = modelFactories.getFactory(JavaImplementationFactory.class); this.policyFactory = modelFactories.getFactory(PolicyFactory.class); this.policyProcessor = new PolicyAttachPointProcessor(policyFactory); this.monitor = monitor; @@ -190,7 +193,7 @@ public class SpringImplementationProcessor implements StAXArtifactProcessor<Spri /* Load the Spring component type by reading the Spring application context */ SpringXMLComponentTypeLoader springLoader = - new SpringXMLComponentTypeLoader(assemblyFactory, javaFactory, policyFactory); + new SpringXMLComponentTypeLoader(assemblyFactory, javaFactory, javaImplementationFactory, policyFactory); try { // Load the Spring Implementation information from its application context file... springLoader.load(springImplementation); diff --git a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringBeanIntrospector.java b/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringBeanIntrospector.java index 625a46b12b..6192f187c9 100644 --- a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringBeanIntrospector.java +++ b/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringBeanIntrospector.java @@ -23,28 +23,10 @@ import java.util.Map; import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.ComponentType; import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory; import org.apache.tuscany.sca.implementation.java.IntrospectionException; +import org.apache.tuscany.sca.implementation.java.JavaElementImpl; import org.apache.tuscany.sca.implementation.java.JavaImplementation; import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory; -import org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl; -import org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.AllowsPassByReferenceProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.BaseJavaClassVisitor; -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.ConversationProcessor; -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.HeuristicPojoProcessor; -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.ScopeProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceProcessor; import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; import org.apache.tuscany.sca.policy.PolicyFactory; @@ -68,31 +50,10 @@ public class SpringBeanIntrospector { */ public SpringBeanIntrospector(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory, + JavaImplementationFactory javaImplementationFactory, PolicyFactory policyFactory) { - javaImplementationFactory = new DefaultJavaImplementationFactory(); - - // Create the list of class visitors - BaseJavaClassVisitor[] extensions = - new BaseJavaClassVisitor[] { - new ConstructorProcessor(assemblyFactory), - new AllowsPassByReferenceProcessor(assemblyFactory), - new ComponentNameProcessor(assemblyFactory), - new ContextProcessor(assemblyFactory), - new ConversationProcessor(assemblyFactory), - new DestroyProcessor(assemblyFactory), - new EagerInitProcessor(assemblyFactory), - new InitProcessor(assemblyFactory), - new PropertyProcessor(assemblyFactory), - new ReferenceProcessor(assemblyFactory, javaFactory), - new ResourceProcessor(assemblyFactory), - new ScopeProcessor(assemblyFactory), - new ServiceProcessor(assemblyFactory, javaFactory), - new HeuristicPojoProcessor(assemblyFactory, javaFactory), - new PolicyProcessor(assemblyFactory, policyFactory)}; - for (JavaClassVisitor extension : extensions) { - javaImplementationFactory.addClassVisitor(extension); - } + this.javaImplementationFactory = javaImplementationFactory; } // end constructor diff --git a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringXMLComponentTypeLoader.java b/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringXMLComponentTypeLoader.java index 9f41fd306f..7bd69b91c2 100644 --- a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringXMLComponentTypeLoader.java +++ b/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringXMLComponentTypeLoader.java @@ -47,7 +47,8 @@ import org.apache.tuscany.sca.assembly.Reference; import org.apache.tuscany.sca.assembly.Service; import org.apache.tuscany.sca.contribution.service.ContributionReadException; import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl; +import org.apache.tuscany.sca.implementation.java.JavaElementImpl; +import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory; import org.apache.tuscany.sca.implementation.spring.SpringImplementation; import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; import org.apache.tuscany.sca.interfacedef.java.JavaInterface; @@ -75,12 +76,13 @@ public class SpringXMLComponentTypeLoader { public SpringXMLComponentTypeLoader(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory, + JavaImplementationFactory javaImplementationFactory, PolicyFactory policyFactory) { super(); this.assemblyFactory = assemblyFactory; this.javaFactory = javaFactory; beanIntrospector = - new SpringBeanIntrospector(assemblyFactory, javaFactory, policyFactory); + new SpringBeanIntrospector(assemblyFactory, javaFactory, javaImplementationFactory, policyFactory); } protected Class<SpringImplementation> getImplementationClass() { |