diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-16 07:21:58 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-16 07:21:58 +0000 |
commit | f955360d1ac83472162e88eb9db4c3c2f1bfb94c (patch) | |
tree | 03165b58cff723cd3bc128f87c1b908277fe77f0 /sca-java-2.x/trunk/modules/core | |
parent | 4e1be687f324ef95c463b5af3769fdc84ce1c858 (diff) |
Rename EndpointRegistry to DomainRegistry. Doing this has been brought up lots of times in the past just no one ever got around to it. It effects quite a few classes but its a relatively trivial rename and i don't think it should impact on anyone too much
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1103629 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
14 files changed, 144 insertions, 144 deletions
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java index 6e6df507c2..313c4bb64e 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java @@ -28,18 +28,18 @@ import org.apache.tuscany.sca.assembly.EndpointReference; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.definitions.Definitions; import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.runtime.EndpointRegistry; +import org.apache.tuscany.sca.runtime.DomainRegistry; import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentContext; /** - * The context associated with the Node that provides access to ExtensionPointRegistry and EndpointRegistry + * The context associated with the Node that provides access to ExtensionPointRegistry and DomainRegistry * * @version $Rev$ $Date$ */ public class CompositeContext { protected ExtensionPointRegistry extensionPointRegistry; - protected EndpointRegistry endpointRegistry; + protected DomainRegistry domainRegistry; protected ComponentContextFactory componentContextFactory; protected Composite domainComposite; protected String nodeURI; @@ -49,13 +49,13 @@ public class CompositeContext { protected Map<String, Object> attributes = new HashMap<String, Object>(); public CompositeContext(ExtensionPointRegistry registry, - EndpointRegistry endpointRegistry, + DomainRegistry domainRegistry, Composite domainComposite, String domainURI, String nodeURI, Definitions systemDefinitions) { this.extensionPointRegistry = registry; - this.endpointRegistry = endpointRegistry; + this.domainRegistry = domainRegistry; ContextFactoryExtensionPoint contextFactories = registry.getExtensionPoint(ContextFactoryExtensionPoint.class); this.componentContextFactory = contextFactories.getFactory(ComponentContextFactory.class); this.domainComposite = domainComposite; @@ -64,8 +64,8 @@ public class CompositeContext { this.systemDefinitions = systemDefinitions; } - public CompositeContext(ExtensionPointRegistry registry, EndpointRegistry endpointRegistry) { - this(registry, endpointRegistry, null, "default", "default", null); + public CompositeContext(ExtensionPointRegistry registry, DomainRegistry domainRegistry) { + this(registry, domainRegistry, null, "default", "default", null); } /** @@ -119,11 +119,11 @@ public class CompositeContext { } /** - * Get the EndpointRegistry - * @return The EndpointRegistry for this node + * Get the DomainRegistry + * @return The DomainRegistry for this node */ - public EndpointRegistry getEndpointRegistry() { - return endpointRegistry; + public DomainRegistry getEndpointRegistry() { + return domainRegistry; } public Composite getDomainComposite() { diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistry.java index e89a4396e0..e3743d535a 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistry.java @@ -32,11 +32,11 @@ import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.LifeCycleListener; /** - * A replicated EndpointRegistry based on Apache Tomcat Tribes + * A replicated DomainRegistry based on Apache Tomcat Tribes * @tuscany.spi.extension.inheritfrom */ -public abstract class BaseEndpointRegistry implements EndpointRegistry, LifeCycleListener { - protected final static Logger logger = Logger.getLogger(BaseEndpointRegistry.class.getName()); +public abstract class BaseDomainRegistry implements DomainRegistry, LifeCycleListener { + protected final static Logger logger = Logger.getLogger(BaseDomainRegistry.class.getName()); protected String domainRegistryURI; protected String domainURI; @@ -47,7 +47,7 @@ public abstract class BaseEndpointRegistry implements EndpointRegistry, LifeCycl protected ExtensionPointRegistry registry; protected Map<String, String> attributes; - public BaseEndpointRegistry(ExtensionPointRegistry registry, + public BaseDomainRegistry(ExtensionPointRegistry registry, Map<String, String> attributes, String domainRegistryURI, String domainURI) { diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistryFactory.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistryFactory.java index 4f6a29bbcc..7f707030ae 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistryFactory.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistryFactory.java @@ -35,7 +35,7 @@ import org.apache.tuscany.sca.core.LifeCycleListener; */ public abstract class BaseDomainRegistryFactory implements DomainRegistryFactory, LifeCycleListener { protected ExtensionPointRegistry registry; - protected Map<Object, EndpointRegistry> endpointRegistries = new ConcurrentHashMap<Object, EndpointRegistry>(); + protected Map<Object, DomainRegistry> domainRegistries = new ConcurrentHashMap<Object, DomainRegistry>(); protected List<EndpointListener> listeners = new ArrayList<EndpointListener>(); /** @@ -49,54 +49,54 @@ public abstract class BaseDomainRegistryFactory implements DomainRegistryFactory public void start() { } - public synchronized EndpointRegistry getEndpointRegistry(String endpointRegistryURI, String domainURI) { + public synchronized DomainRegistry getEndpointRegistry(String endpointRegistryURI, String domainURI) { if (endpointRegistryURI == null) { endpointRegistryURI = domainURI; } Object key = getKey(endpointRegistryURI, domainURI); - EndpointRegistry endpointRegistry = endpointRegistries.get(key); - if (endpointRegistry != null) { - return endpointRegistry; + DomainRegistry domainRegistry = domainRegistries.get(key); + if (domainRegistry != null) { + return domainRegistry; } - endpointRegistry = createEndpointRegistry(endpointRegistryURI, domainURI); + domainRegistry = createEndpointRegistry(endpointRegistryURI, domainURI); - if (endpointRegistry instanceof LifeCycleListener) { - ((LifeCycleListener)endpointRegistry).start(); + if (domainRegistry instanceof LifeCycleListener) { + ((LifeCycleListener)domainRegistry).start(); } for (EndpointListener listener : listeners) { - endpointRegistry.addListener(listener); + domainRegistry.addListener(listener); } - endpointRegistries.put(key, endpointRegistry); - return endpointRegistry; + domainRegistries.put(key, domainRegistry); + return domainRegistry; } protected Object getKey(String endpointRegistryURI, String domainURI) { return endpointRegistryURI + "," + domainURI; } - protected abstract EndpointRegistry createEndpointRegistry(String endpointRegistryURI, String domainURI); + protected abstract DomainRegistry createEndpointRegistry(String endpointRegistryURI, String domainURI); public void stop() { - for (EndpointRegistry endpointRegistry : endpointRegistries.values()) { - if (endpointRegistry instanceof LifeCycleListener) { - ((LifeCycleListener)endpointRegistry).stop(); + for (DomainRegistry domainRegistry : domainRegistries.values()) { + if (domainRegistry instanceof LifeCycleListener) { + ((LifeCycleListener)domainRegistry).stop(); } } - endpointRegistries.clear(); + domainRegistries.clear(); listeners.clear(); } - public synchronized Collection<EndpointRegistry> getEndpointRegistries() { - return new ArrayList<EndpointRegistry>(endpointRegistries.values()); + public synchronized Collection<DomainRegistry> getEndpointRegistries() { + return new ArrayList<DomainRegistry>(domainRegistries.values()); } public synchronized void addListener(EndpointListener listener) { listeners.add(listener); - for (EndpointRegistry registry : endpointRegistries.values()) { + for (DomainRegistry registry : domainRegistries.values()) { registry.addListener(listener); } } @@ -107,7 +107,7 @@ public abstract class BaseDomainRegistryFactory implements DomainRegistryFactory public synchronized void removeListener(EndpointListener listener) { listeners.remove(listener); - for (EndpointRegistry registry : endpointRegistries.values()) { + for (DomainRegistry registry : domainRegistries.values()) { registry.removeListener(listener); } } diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.java index 1337cab4b2..95fca25431 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.java @@ -30,10 +30,10 @@ import org.apache.tuscany.sca.assembly.Endpoint; import org.apache.tuscany.sca.assembly.EndpointReference; /** - * The EndpointRegistry holds the active service endpoints for the SCA domain + * The DomainRegistry holds the active service endpoints for the SCA domain * @tuscany.spi.extension.inheritfrom */ -public interface EndpointRegistry { +public interface DomainRegistry { /** * Add an enpoint to the registry. If the endpoint URI is the same as an existing endpoint in the registry, * the existing one will be updated diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java index c79fab1f47..69ed07763e 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java @@ -27,19 +27,19 @@ import java.util.Collection; */ public interface DomainRegistryFactory { /** - * Get the EndpointRegistry for the given registry URI and domain URI + * Get the DomainRegistry for the given registry URI and domain URI * @param endpointRegistryURI A URI can be used to connect to the registry, such as vm://localhost * or multicast://200.0.100.200:50000/... * @param domainURI The domain URI * @return */ - EndpointRegistry getEndpointRegistry(String endpointRegistryURI, String domainURI); + DomainRegistry getEndpointRegistry(String endpointRegistryURI, String domainURI); /** * Return all active endpoint registries * @return */ - Collection<EndpointRegistry> getEndpointRegistries(); + Collection<DomainRegistry> getEndpointRegistries(); /** * Add an EndpointListener diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java index 60f8a5c5a0..79e8dfc475 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java @@ -24,30 +24,30 @@ import org.apache.tuscany.sca.assembly.builder.BuilderContext; /** * A utility responsible for resolving the endpoint reference against a matching endpoint published - * to the EndpointRegistry + * to the DomainRegistry */ public interface EndpointReferenceBinder { /** - * @param endpointRegistry + * @param domainRegistry * @param endpointReference * @return */ - void bindBuildTime(EndpointRegistry endpointRegistry, EndpointReference endpointReference, BuilderContext builderContext); + void bindBuildTime(DomainRegistry domainRegistry, EndpointReference endpointReference, BuilderContext builderContext); /** - * @param endpointRegistry + * @param domainRegistry * @param endpointReference * @return */ - void bindRunTime(EndpointRegistry endpointRegistry, EndpointReference endpointReference); + void bindRunTime(DomainRegistry domainRegistry, EndpointReference endpointReference); /** * - * @param endpointRegistry + * @param domainRegistry * @param endpointReference * @return */ - boolean isOutOfDate(EndpointRegistry endpointRegistry, EndpointReference endpointReference); + boolean isOutOfDate(DomainRegistry domainRegistry, EndpointReference endpointReference); } diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistryFactory.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistryFactory.java index 43ee78b985..64af944c9f 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistryFactory.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistryFactory.java @@ -63,15 +63,15 @@ public class ExtensibleDomainRegistryFactory implements DomainRegistryFactory { } } - public Collection<EndpointRegistry> getEndpointRegistries() { - List<EndpointRegistry> registries = new ArrayList<EndpointRegistry>(); + public Collection<DomainRegistry> getEndpointRegistries() { + List<DomainRegistry> registries = new ArrayList<DomainRegistry>(); for (DomainRegistryFactory factory : factories.getDomainRegistryFactories()) { registries.addAll(factory.getEndpointRegistries()); } return registries; } - public EndpointRegistry getEndpointRegistry(String endpointRegistryURI, String domainURI) { + public DomainRegistry getEndpointRegistry(String endpointRegistryURI, String domainURI) { if (endpointRegistryURI == null) { endpointRegistryURI = factories.getDomainRegistryMapping().get(domainURI); if (endpointRegistryURI == null) { @@ -84,9 +84,9 @@ public class ExtensibleDomainRegistryFactory implements DomainRegistryFactory { // See if there is a previously created registry for that domain for (DomainRegistryFactory factory : factories.getDomainRegistryFactories()) { - for (EndpointRegistry endpointRegistry : factory.getEndpointRegistries()) { - if (endpointRegistry.getDomainURI().equals(domainURI)) { - return endpointRegistry; + for (DomainRegistry domainRegistry : factory.getEndpointRegistries()) { + if (domainRegistry.getDomainURI().equals(domainURI)) { + return domainRegistry; } } } @@ -99,15 +99,15 @@ public class ExtensibleDomainRegistryFactory implements DomainRegistryFactory { for (DomainRegistryFactory factory : factories.getDomainRegistryFactories()) { String[] schemes = factory.getSupportedSchemes(); if (schemes != null && Arrays.asList(schemes).contains(scheme)) { - EndpointRegistry endpointRegistry = factory.getEndpointRegistry(endpointRegistryURI, domainURI); - if (endpointRegistry == null) { + DomainRegistry domainRegistry = factory.getEndpointRegistry(endpointRegistryURI, domainURI); + if (domainRegistry == null) { continue; } else { - return endpointRegistry; + return domainRegistry; } } } - throw new ServiceRuntimeException("No EndpointRegistry can support " + endpointRegistryURI); + throw new ServiceRuntimeException("No DomainRegistry can support " + endpointRegistryURI); } public void removeListener(EndpointListener listener) { diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java index eef7a88046..78a87191de 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java @@ -47,9 +47,9 @@ public interface Invocable { * Bind the invocable to the extension point registry and endpoint registry. This is typically * called after the endpoint or endpoint reference is deserialized * @param registry - * @param endpointRegistry + * @param domainRegistry */ - void bind(ExtensionPointRegistry registry, EndpointRegistry endpointRegistry); + void bind(ExtensionPointRegistry registry, DomainRegistry domainRegistry); /** * Get the associated composite context diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointRegistryImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java index e18b96c50b..6b99b77802 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointRegistryImpl.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java @@ -36,18 +36,18 @@ import org.apache.tuscany.sca.assembly.Endpoint; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.LifeCycleListener; import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.runtime.BaseEndpointRegistry; +import org.apache.tuscany.sca.runtime.BaseDomainRegistry; import org.apache.tuscany.sca.runtime.ContributionListener; import org.apache.tuscany.sca.runtime.EndpointListener; -import org.apache.tuscany.sca.runtime.EndpointRegistry; +import org.apache.tuscany.sca.runtime.DomainRegistry; import org.apache.tuscany.sca.runtime.InstalledContribution; import org.apache.tuscany.sca.runtime.RuntimeProperties; /** - * A EndpointRegistry implementation that sees registrations from the same JVM + * A DomainRegistry implementation that sees registrations from the same JVM */ -public class EndpointRegistryImpl extends BaseEndpointRegistry implements EndpointRegistry, LifeCycleListener { - private final Logger logger = Logger.getLogger(EndpointRegistryImpl.class.getName()); +public class DomainRegistryImpl extends BaseDomainRegistry implements DomainRegistry, LifeCycleListener { + private final Logger logger = Logger.getLogger(DomainRegistryImpl.class.getName()); private List<Endpoint> endpoints = new ArrayList<Endpoint>(); private Map<String, Map<QName, Composite>> runningComposites = new HashMap<String, Map<QName, Composite>>(); @@ -55,7 +55,7 @@ public class EndpointRegistryImpl extends BaseEndpointRegistry implements Endpoi protected boolean quietLogging; - public EndpointRegistryImpl(ExtensionPointRegistry extensionPoints, String endpointRegistryURI, String domainURI) { + public DomainRegistryImpl(ExtensionPointRegistry extensionPoints, String endpointRegistryURI, String domainURI) { super(extensionPoints, null, endpointRegistryURI, domainURI); Properties runtimeProps = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class).getUtility(RuntimeProperties.class).getProperties(); quietLogging = Boolean.parseBoolean(runtimeProps.getProperty(RuntimeProperties.QUIET_LOGGING)); diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/LocalDomainRegistryFactory.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/LocalDomainRegistryFactory.java index b7d83e754a..002eb774ef 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/LocalDomainRegistryFactory.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/LocalDomainRegistryFactory.java @@ -21,7 +21,7 @@ package org.apache.tuscany.sca.core.assembly.impl; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.runtime.BaseDomainRegistryFactory; -import org.apache.tuscany.sca.runtime.EndpointRegistry; +import org.apache.tuscany.sca.runtime.DomainRegistry; /** * The utility responsible for finding the endpoint regstry by the scheme and creating instances for the @@ -37,10 +37,10 @@ public class LocalDomainRegistryFactory extends BaseDomainRegistryFactory { super(registry); } - protected EndpointRegistry createEndpointRegistry(String endpointRegistryURI, String domainURI) { - EndpointRegistry endpointRegistry = - new EndpointRegistryImpl(registry, endpointRegistryURI, domainURI); - return endpointRegistry; + protected DomainRegistry createEndpointRegistry(String endpointRegistryURI, String domainURI) { + DomainRegistry domainRegistry = + new DomainRegistryImpl(registry, endpointRegistryURI, domainURI); + return domainRegistry; } public String[] getSupportedSchemes() { 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 adad30c778..8e04a6ae47 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 @@ -95,7 +95,7 @@ import org.apache.tuscany.sca.provider.PolicyProviderFactory; import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint; import org.apache.tuscany.sca.provider.ServiceBindingProvider; import org.apache.tuscany.sca.runtime.DomainRegistryFactory; -import org.apache.tuscany.sca.runtime.EndpointRegistry; +import org.apache.tuscany.sca.runtime.DomainRegistry; import org.apache.tuscany.sca.runtime.EndpointSerializer; import org.apache.tuscany.sca.runtime.ExtensibleDomainRegistryFactory; import org.apache.tuscany.sca.runtime.RuntimeComponent; @@ -181,9 +181,9 @@ public class RuntimeEndpointImpl extends EndpointImpl implements RuntimeEndpoint bind(compositeContext.getExtensionPointRegistry(), compositeContext.getEndpointRegistry()); } - public void bind(ExtensionPointRegistry registry, EndpointRegistry endpointRegistry) { + public void bind(ExtensionPointRegistry registry, DomainRegistry domainRegistry) { if (compositeContext == null) { - compositeContext = new CompositeContext(registry, endpointRegistry); + compositeContext = new CompositeContext(registry, domainRegistry); } // if interfaceContractMapper is already initialized then all the rest will be too @@ -435,8 +435,8 @@ public class RuntimeEndpointImpl extends EndpointImpl implements RuntimeEndpoint // Store the new callback EPR into the Endpoint this.getCallbackEndpointReferences().add(asyncEPR); - // Also store the callback EPR into the EndpointRegistry - EndpointRegistry epReg = getEndpointRegistry( registry ); + // Also store the callback EPR into the DomainRegistry + DomainRegistry epReg = getEndpointRegistry( registry ); if( epReg != null ) epReg.addEndpointReference(asyncEPR); } // end method createAsyncServerCallback @@ -931,7 +931,7 @@ public class RuntimeEndpointImpl extends EndpointImpl implements RuntimeEndpoint 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 + // Find the actual Endpoint in the DomainRegistry ep = findActualEP( ep, registry ); if( ep != null ){ copyFrom( ep ); @@ -943,19 +943,19 @@ public class RuntimeEndpointImpl extends EndpointImpl implements RuntimeEndpoint } // end method resolve /** - * Find the actual Endpoint in the EndpointRegistry which corresponds to the configuration described + * Find the actual Endpoint in the DomainRegistry which corresponds to the configuration described * in a deserialized Endpoint * @param ep The deserialized endpoint * @param registry - the main extension point Registry - * @return the corresponding Endpoint from the EndpointRegistry, or null if no match can be found + * @return the corresponding Endpoint from the DomainRegistry, or null if no match can be found */ private RuntimeEndpointImpl findActualEP(RuntimeEndpointImpl ep, ExtensionPointRegistry registry) { - EndpointRegistry endpointRegistry = getEndpointRegistry( registry ); + DomainRegistry domainRegistry = getEndpointRegistry( registry ); - if( endpointRegistry == null ) return null; + if( domainRegistry == null ) return null; - for( Endpoint endpoint : endpointRegistry.findEndpoint(ep.getURI()) ) { + for( Endpoint endpoint : domainRegistry.findEndpoint(ep.getURI()) ) { // TODO: For the present, simply return the first matching endpoint return (RuntimeEndpointImpl) endpoint; } // end for @@ -964,19 +964,19 @@ public class RuntimeEndpointImpl extends EndpointImpl implements RuntimeEndpoint } // end method findActualEP /** - * Get the EndpointRegistry + * Get the DomainRegistry * @param registry - the ExtensionPoint registry - * @return the EndpointRegistry - will be null if the EndpointRegistry cannot be found + * @return the DomainRegistry - will be null if the DomainRegistry cannot be found */ - private EndpointRegistry getEndpointRegistry( ExtensionPointRegistry registry) { + private DomainRegistry getEndpointRegistry( ExtensionPointRegistry registry) { DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(registry); if( domainRegistryFactory == null ) return null; - // TODO: For the moment, just use the first (and only!) EndpointRegistry... - EndpointRegistry endpointRegistry = (EndpointRegistry) domainRegistryFactory.getEndpointRegistries().toArray()[0]; + // TODO: For the moment, just use the first (and only!) DomainRegistry... + DomainRegistry domainRegistry = (DomainRegistry) domainRegistryFactory.getEndpointRegistries().toArray()[0]; - return endpointRegistry; + return domainRegistry; } // end method public InterfaceContract getBindingInterfaceContract() { 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 410056628b..e990231841 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 @@ -81,7 +81,7 @@ import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint; import org.apache.tuscany.sca.provider.ReferenceBindingProvider; import org.apache.tuscany.sca.runtime.DomainRegistryFactory; import org.apache.tuscany.sca.runtime.EndpointReferenceBinder; -import org.apache.tuscany.sca.runtime.EndpointRegistry; +import org.apache.tuscany.sca.runtime.DomainRegistry; import org.apache.tuscany.sca.runtime.EndpointSerializer; import org.apache.tuscany.sca.runtime.ExtensibleDomainRegistryFactory; import org.apache.tuscany.sca.runtime.RuntimeComponent; @@ -104,7 +104,7 @@ public class RuntimeEndpointReferenceImpl extends EndpointReferenceImpl implemen private transient PhaseManager phaseManager; private transient MessageFactory messageFactory; private transient RuntimeInvoker invoker; - private transient EndpointRegistry endpointRegistry; + private transient DomainRegistry domainRegistry; private transient List<InvocationChain> chains; private transient Map<Operation, InvocationChain> invocationChainMap = @@ -173,12 +173,12 @@ public class RuntimeEndpointReferenceImpl extends EndpointReferenceImpl implemen bind(compositeContext.getExtensionPointRegistry(), compositeContext.getEndpointRegistry()); } - public void bind(ExtensionPointRegistry registry, EndpointRegistry endpointRegistry) { + public void bind(ExtensionPointRegistry registry, DomainRegistry domainRegistry) { if (compositeContext == null) { - compositeContext = new CompositeContext(registry, endpointRegistry); + compositeContext = new CompositeContext(registry, domainRegistry); } this.registry = registry; - this.endpointRegistry = endpointRegistry; + this.domainRegistry = domainRegistry; UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); this.eprBinder = utilities.getUtility(EndpointReferenceBinder.class); this.interfaceContractMapper = utilities.getUtility(InterfaceContractMapper.class); @@ -427,7 +427,7 @@ public class RuntimeEndpointReferenceImpl extends EndpointReferenceImpl implemen private void resolveEndpointReference() { resolve(); - eprBinder.bindRunTime(endpointRegistry, this); + eprBinder.bindRunTime(domainRegistry, this); // start the binding provider final ReferenceBindingProvider bindingProvider = getBindingProvider(); @@ -539,7 +539,7 @@ public class RuntimeEndpointReferenceImpl extends EndpointReferenceImpl implemen public boolean isOutOfDate() { resolve(); - return eprBinder.isOutOfDate(endpointRegistry, this); + return eprBinder.isOutOfDate(domainRegistry, this); } public synchronized ReferenceBindingProvider getBindingProvider() { @@ -648,7 +648,7 @@ public class RuntimeEndpointReferenceImpl extends EndpointReferenceImpl implemen 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 + // Find the actual Endpoint in the DomainRegistry epr = findActualEPR( epr, registry ); if( epr != null ){ copyFrom( epr ); @@ -660,23 +660,23 @@ public class RuntimeEndpointReferenceImpl extends EndpointReferenceImpl implemen } // end method resolve /** - * Find the actual EndpointReference in the EndpointRegistry which corresponds to the configuration described + * Find the actual EndpointReference in the DomainRegistry which corresponds to the configuration described * in a deserialized EndpointReference * @param ep The deserialized endpointReference * @param registry - the main extension point Registry - * @return the corresponding EndpointReference from the EndpointRegistry, or null if no match can be found + * @return the corresponding EndpointReference from the DomainRegistry, or null if no match can be found */ private RuntimeEndpointReferenceImpl findActualEPR(RuntimeEndpointReferenceImpl epr, ExtensionPointRegistry registry) { - // Get the EndpointRegistry + // Get the DomainRegistry DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(registry); if( domainRegistryFactory == null ) return null; - // TODO: For the moment, just use the first (and only!) EndpointRegistry... - EndpointRegistry endpointRegistry = (EndpointRegistry) domainRegistryFactory.getEndpointRegistries().toArray()[0]; - if( endpointRegistry == null ) return null; + // TODO: For the moment, just use the first (and only!) DomainRegistry... + DomainRegistry domainRegistry = (DomainRegistry) domainRegistryFactory.getEndpointRegistries().toArray()[0]; + if( domainRegistry == null ) return null; - for( EndpointReference epReference : endpointRegistry.getEndpointReferences() ) { + for( EndpointReference epReference : domainRegistry.getEndpointReferences() ) { // TODO: For the present, simply return the first matching endpointReference if( epReference.getURI().equals(epr.getURI()) ) { return (RuntimeEndpointReferenceImpl) epReference; 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 87b8da62a9..1ebc9c633a 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 @@ -37,7 +37,7 @@ import org.apache.tuscany.sca.invocation.Message; import org.apache.tuscany.sca.invocation.MessageFactory;
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.DomainRegistry;
import org.apache.tuscany.sca.runtime.ExtensibleDomainRegistryFactory;
import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
@@ -70,7 +70,7 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab private String endpointReferenceURI;
private String domainURI;
- private transient EndpointRegistry endpointRegistry;
+ private transient DomainRegistry domainRegistry;
private transient ExtensionPointRegistry registry;
public AsyncResponseInvoker(RuntimeEndpoint requestEndpoint,
@@ -256,8 +256,8 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab */
private RuntimeEndpointReference retrieveEndpointReference(String uri) {
if( uri == null ) return null;
- if( endpointRegistry == null ) return null;
- List<EndpointReference> refs = endpointRegistry.findEndpointReferences( uri );
+ if( domainRegistry == null ) return null;
+ List<EndpointReference> refs = domainRegistry.findEndpointReferences( uri );
// If there is more than EndpointReference with the uri...
if( refs.isEmpty() ) return null;
// TODO: what if there is more than 1 EPR with the given URI?
@@ -266,37 +266,37 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab /**
* Fetches the Endpoint identified by an endpoint URI
- * - the Endpoint is retrieved from the EndpointRegistry
+ * - the Endpoint is retrieved from the DomainRegistry
* @param uri - the URI of the Endpoint
* @return - the Endpoint corresponding to the URI, or null if no Endpoint is found which has the
* supplied URI
*/
private RuntimeEndpoint retrieveEndpoint(String uri) {
if( uri == null ) return null;
- if( endpointRegistry == null ) endpointRegistry = getEndpointRegistry( uri );
- if( endpointRegistry == null ) return null;
+ if( domainRegistry == null ) domainRegistry = getEndpointRegistry( uri );
+ if( domainRegistry == null ) return null;
// TODO what if more than one Endpoint gets returned??
- return (RuntimeEndpoint) endpointRegistry.findEndpoint(uri).get(0);
+ return (RuntimeEndpoint) domainRegistry.findEndpoint(uri).get(0);
} // end method retrieveEndpoint
/**
- * Gets the EndpointRegistry which contains an Endpoint with the supplied URI
+ * Gets the DomainRegistry which contains an Endpoint with the supplied URI
* @param uri - The URI of an Endpoint
- * @return - the EndpointRegistry containing the Endpoint with the supplied URI - null if no
- * such EndpointRegistry can be found
+ * @return - the DomainRegistry containing the Endpoint with the supplied URI - null if no
+ * such DomainRegistry can be found
*/
- private EndpointRegistry getEndpointRegistry(String uri) {
+ private DomainRegistry getEndpointRegistry(String uri) {
ExtensionPointRegistry registry = null;
- EndpointRegistry endpointRegistry = null;
+ DomainRegistry domainRegistry = null;
CompositeContext context = CompositeContext.getCurrentCompositeContext();
if( context == null && requestEndpoint != null ) context = requestEndpoint.getCompositeContext();
if( context != null ) {
registry = context.getExtensionPointRegistry();
- endpointRegistry = getEndpointRegistry( registry );
- if( endpointRegistry != null ) {
+ domainRegistry = getEndpointRegistry( registry );
+ if( domainRegistry != null ) {
this.registry = registry;
- return endpointRegistry;
+ return domainRegistry;
} // end if
} // end if
@@ -304,14 +304,14 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab for(ExtensionPointRegistry r : ExtensionPointRegistryLocator.getExtensionPointRegistries()) {
registry = r;
if( registry != null ) {
- // Find the actual Endpoint in the EndpointRegistry
- endpointRegistry = getEndpointRegistry( registry );
+ // Find the actual Endpoint in the DomainRegistry
+ domainRegistry = getEndpointRegistry( registry );
- if( endpointRegistry != null ) {
- for( Endpoint endpoint : endpointRegistry.findEndpoint(uri) ) {
+ if( domainRegistry != null ) {
+ for( Endpoint endpoint : domainRegistry.findEndpoint(uri) ) {
// TODO: For the present, simply return the first registry with a matching endpoint
this.registry = registry;
- return endpointRegistry;
+ return domainRegistry;
} // end for
} // end if
} // end if
@@ -321,27 +321,27 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab } // end method getEndpointRegistry
/**
- * Get the EndpointRegistry
+ * Get the DomainRegistry
* @param registry - the ExtensionPoint registry
- * @return the EndpointRegistry - will be null if the EndpointRegistry cannot be found
+ * @return the DomainRegistry - will be null if the DomainRegistry cannot be found
*/
- private EndpointRegistry getEndpointRegistry( ExtensionPointRegistry registry) {
+ private DomainRegistry getEndpointRegistry( ExtensionPointRegistry registry) {
DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(registry);
if( domainRegistryFactory == null ) return null;
// Find the first endpoint registry that matches the domain name
if( domainURI != null ) {
- for( EndpointRegistry endpointRegistry : domainRegistryFactory.getEndpointRegistries() ) {
- if( domainURI.equals( endpointRegistry.getDomainURI() ) ) return endpointRegistry;
+ for( DomainRegistry domainRegistry : domainRegistryFactory.getEndpointRegistries() ) {
+ if( domainURI.equals( domainRegistry.getDomainURI() ) ) return domainRegistry;
} // end for
} // end if
- // if there was no domainName to match, simply return the first EndpointRegistry if there is one...
+ // if there was no domainName to match, simply return the first DomainRegistry if there is one...
if (domainRegistryFactory.getEndpointRegistries().size() > 0){
- EndpointRegistry endpointRegistry = (EndpointRegistry) domainRegistryFactory.getEndpointRegistries().toArray()[0];
- return endpointRegistry;
+ DomainRegistry domainRegistry = (DomainRegistry) domainRegistryFactory.getEndpointRegistries().toArray()[0];
+ return domainRegistry;
} else {
return null;
}
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java index 068f13f953..cfdb099423 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java @@ -60,7 +60,7 @@ import org.apache.tuscany.sca.provider.EndpointReferenceAsyncProvider; import org.apache.tuscany.sca.provider.ReferenceBindingProvider; import org.apache.tuscany.sca.runtime.CompositeActivator; import org.apache.tuscany.sca.runtime.EndpointReferenceBinder; -import org.apache.tuscany.sca.runtime.EndpointRegistry; +import org.apache.tuscany.sca.runtime.DomainRegistry; import org.apache.tuscany.sca.runtime.RuntimeEndpoint; import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; import org.apache.tuscany.sca.runtime.UnknownEndpointHandler; @@ -110,35 +110,35 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { * Bind a single endpoint reference at build time. Here we only expect the * registry to have a record of local endpoints * - * @param endpointRegistry + * @param domainRegistry * @param endpointReference */ - public void bindBuildTime(EndpointRegistry endpointRegistry, + public void bindBuildTime(DomainRegistry domainRegistry, EndpointReference endpointReference, BuilderContext builderContext) { - bind(endpointRegistry, endpointReference, builderContext, false); + bind(domainRegistry, endpointReference, builderContext, false); } /** * Bind a single endpoint reference at run time. Here we expect the * registry to be populated with endpoints from across the domain * - * @param endpointRegistry + * @param domainRegistry * @param endpointReference */ - public void bindRunTime(EndpointRegistry endpointRegistry, + public void bindRunTime(DomainRegistry domainRegistry, EndpointReference endpointReference) { - bind(endpointRegistry, endpointReference, null, true); + bind(domainRegistry, endpointReference, null, true); } /** * Bind a reference to a service endpoint * - * @param endpointRegistry + * @param domainRegistry * @param endpointReference * @param runtime set true if called from the runtime */ - public void bind(EndpointRegistry endpointRegistry, + public void bind(DomainRegistry domainRegistry, EndpointReference endpointReference, BuilderContext builderContext, boolean runtime){ @@ -154,7 +154,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { // do autowire matching // will only be called at build time at the moment Multiplicity multiplicity = endpointReference.getReference().getMultiplicity(); - for (Endpoint endpoint : endpointRegistry.getEndpoints()){ + for (Endpoint endpoint : domainRegistry.getEndpoints()){ // if (endpoint is in the same composite as endpoint reference){ if ((multiplicity == Multiplicity.ZERO_ONE || multiplicity == Multiplicity.ONE_ONE) && @@ -253,7 +253,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { // The reference is not yet matched to a service // find the service in the endpoint registry - List<Endpoint> endpoints = endpointRegistry.findEndpoint(endpointReference); + List<Endpoint> endpoints = domainRegistry.findEndpoint(endpointReference); if (endpoints.size() > 0){ selectForwardEndpoint(endpointReference, @@ -917,12 +917,12 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { * * @return true is the registry has changed */ - public boolean isOutOfDate(EndpointRegistry endpointRegistry, EndpointReference endpointReference) { + public boolean isOutOfDate(DomainRegistry domainRegistry, EndpointReference endpointReference) { Endpoint te = endpointReference.getTargetEndpoint(); if (te != null && !te.isUnresolved() && te.getURI() != null && endpointReference.getStatus() != EndpointReference.Status.RESOLVED_BINDING) { - List<Endpoint> endpoints = endpointRegistry.findEndpoint(endpointReference); + List<Endpoint> endpoints = domainRegistry.findEndpoint(endpointReference); return ! endpoints.contains(endpointReference.getTargetEndpoint()); } return false; |