From 27e7df7cfb7e9d33348dc32652a65d373fd146f9 Mon Sep 17 00:00:00 2001 From: antelder Date: Sat, 5 Mar 2011 10:51:46 +0000 Subject: Fix dependency tangle by removing the dependency on node from core git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1078265 13f79535-47bb-0310-9956-ffa450edef68 --- sca-java-2.x/trunk/modules/core/pom.xml | 6 ---- .../core/assembly/impl/RuntimeEndpointImpl.java | 32 ++++++++++------------ .../impl/RuntimeEndpointReferenceImpl.java | 31 +++++++++------------ .../sca/core/invocation/AsyncResponseInvoker.java | 14 ++-------- 4 files changed, 30 insertions(+), 53 deletions(-) (limited to 'sca-java-2.x/trunk/modules') diff --git a/sca-java-2.x/trunk/modules/core/pom.xml b/sca-java-2.x/trunk/modules/core/pom.xml index 8eee896831..8354a8e925 100644 --- a/sca-java-2.x/trunk/modules/core/pom.xml +++ b/sca-java-2.x/trunk/modules/core/pom.xml @@ -53,12 +53,6 @@ 2.0-SNAPSHOT - - org.apache.tuscany.sca - tuscany-node-api - 2.0-SNAPSHOT - - cglib cglib diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java index 0f86ee79ba..7dc1a7639a 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java @@ -58,6 +58,7 @@ import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; import org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory; import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.ExtensionPointRegistryLocator; import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.UtilityExtensionPoint; import org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory; @@ -83,7 +84,6 @@ import org.apache.tuscany.sca.invocation.InvokerAsyncResponse; import org.apache.tuscany.sca.invocation.Message; import org.apache.tuscany.sca.invocation.MessageFactory; import org.apache.tuscany.sca.invocation.Phase; -import org.apache.tuscany.sca.node.NodeFactory; import org.apache.tuscany.sca.provider.BindingProviderFactory; import org.apache.tuscany.sca.provider.EndpointAsyncProvider; import org.apache.tuscany.sca.provider.EndpointProvider; @@ -919,23 +919,19 @@ public class RuntimeEndpointImpl extends EndpointImpl implements RuntimeEndpoint } else { // In this case, we assume that we're running on a detached (non Tuscany) thread and // as a result we need to connect back to the Tuscany environment... - for( NodeFactory factory : NodeFactory.getNodeFactories() ) { - ExtensionPointRegistry registry = factory.getExtensionPointRegistry(); - if( registry != null ) { - this.registry = registry; - UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); - this.interfaceContractMapper = utilities.getUtility(InterfaceContractMapper.class); - this.serializer = utilities.getUtility(EndpointSerializer.class); - RuntimeEndpointImpl ep = (RuntimeEndpointImpl)serializer.readEndpoint(xml); - // Find the actual Endpoint in the EndpointRegistry - ep = findActualEP( ep, registry ); - - if( ep != null ){ - copyFrom( ep ); - break; - } // end if - } // end if - } // end for + ExtensionPointRegistry registry = ExtensionPointRegistryLocator.getExtensionPointRegistry(); + if( registry != null ) { + this.registry = registry; + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + this.interfaceContractMapper = utilities.getUtility(InterfaceContractMapper.class); + this.serializer = utilities.getUtility(EndpointSerializer.class); + RuntimeEndpointImpl ep = (RuntimeEndpointImpl)serializer.readEndpoint(xml); + // Find the actual Endpoint in the EndpointRegistry + ep = findActualEP( ep, registry ); + if( ep != null ){ + copyFrom( ep ); + } // end if + } // end if } // end if } // end if super.resolve(); diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java index 5031ccb73a..410056628b 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java @@ -38,7 +38,6 @@ import org.apache.tuscany.sca.assembly.ComponentService; import org.apache.tuscany.sca.assembly.CompositeReference; import org.apache.tuscany.sca.assembly.CompositeService; import org.apache.tuscany.sca.assembly.Contract; -import org.apache.tuscany.sca.assembly.Endpoint; import org.apache.tuscany.sca.assembly.EndpointReference; import org.apache.tuscany.sca.assembly.builder.BindingBuilder; import org.apache.tuscany.sca.assembly.builder.BuilderContext; @@ -46,6 +45,7 @@ import org.apache.tuscany.sca.assembly.builder.BuilderExtensionPoint; import org.apache.tuscany.sca.assembly.impl.EndpointReferenceImpl; import org.apache.tuscany.sca.context.CompositeContext; import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.ExtensionPointRegistryLocator; import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.UtilityExtensionPoint; import org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory; @@ -71,7 +71,6 @@ import org.apache.tuscany.sca.invocation.InvokerAsyncResponse; import org.apache.tuscany.sca.invocation.Message; import org.apache.tuscany.sca.invocation.MessageFactory; import org.apache.tuscany.sca.invocation.Phase; -import org.apache.tuscany.sca.node.NodeFactory; import org.apache.tuscany.sca.provider.BindingProviderFactory; import org.apache.tuscany.sca.provider.EndpointReferenceProvider; import org.apache.tuscany.sca.provider.ImplementationAsyncProvider; @@ -643,22 +642,18 @@ public class RuntimeEndpointReferenceImpl extends EndpointReferenceImpl implemen } else { // In this case, we assume that we're running on a detached (non Tuscany) thread and // as a result we need to connect back to the Tuscany environment... - for( NodeFactory factory : NodeFactory.getNodeFactories() ) { - ExtensionPointRegistry registry = factory.getExtensionPointRegistry(); - if( registry != null ) { - this.registry = registry; - UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); - this.serializer = utilities.getUtility(EndpointSerializer.class); - RuntimeEndpointReferenceImpl epr = (RuntimeEndpointReferenceImpl)serializer.readEndpointReference(xml); - // Find the actual Endpoint in the EndpointRegistry - epr = findActualEPR( epr, registry ); - - if( epr != null ){ - copyFrom( epr ); - break; - } // end if - } // end if - } // end for + ExtensionPointRegistry registry = ExtensionPointRegistryLocator.getExtensionPointRegistry(); + if( registry != null ) { + this.registry = registry; + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + this.serializer = utilities.getUtility(EndpointSerializer.class); + RuntimeEndpointReferenceImpl epr = (RuntimeEndpointReferenceImpl)serializer.readEndpointReference(xml); + // Find the actual Endpoint in the EndpointRegistry + epr = findActualEPR( epr, registry ); + if( epr != null ){ + copyFrom( epr ); + } // end if + } // end if } // end if } super.resolve(); diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java index da1c7f365e..1186da72f0 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java @@ -22,8 +22,6 @@ package org.apache.tuscany.sca.core.invocation; import java.io.IOException; import java.io.ObjectInputStream; import java.io.Serializable; -import java.util.Collection; -import java.util.Iterator; import java.util.List; import java.util.Map; @@ -31,24 +29,18 @@ import org.apache.tuscany.sca.assembly.Endpoint; import org.apache.tuscany.sca.assembly.EndpointReference; import org.apache.tuscany.sca.context.CompositeContext; import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.ExtensionPointRegistryLocator; import org.apache.tuscany.sca.core.FactoryExtensionPoint; -import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.invocation.InvokerAsyncResponse; import org.apache.tuscany.sca.invocation.Message; import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.node.NodeFactory; import org.apache.tuscany.sca.provider.EndpointAsyncProvider; import org.apache.tuscany.sca.runtime.DomainRegistryFactory; import org.apache.tuscany.sca.runtime.EndpointRegistry; -import org.apache.tuscany.sca.runtime.EndpointSerializer; import org.apache.tuscany.sca.runtime.ExtensibleDomainRegistryFactory; import org.apache.tuscany.sca.runtime.RuntimeEndpoint; import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; -import org.oasisopen.sca.ComponentContext; /** * A class that wraps the mechanics for sending async responses @@ -309,8 +301,8 @@ public class AsyncResponseInvoker implements InvokerAsyncResponse, Serializab } // end if // Deal with the case where there is no context available - for( NodeFactory factory : NodeFactory.getNodeFactories() ) { - registry = factory.getExtensionPointRegistry(); + for(ExtensionPointRegistry r : ExtensionPointRegistryLocator.getExtensionPointRegistries()) { + registry = r; if( registry != null ) { // Find the actual Endpoint in the EndpointRegistry endpointRegistry = getEndpointRegistry( registry ); -- cgit v1.2.3