From f955360d1ac83472162e88eb9db4c3c2f1bfb94c Mon Sep 17 00:00:00 2001 From: antelder Date: Mon, 16 May 2011 07:21:58 +0000 Subject: 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 --- .../org/apache/tuscany/sca/TuscanyRuntime.java | 14 ++++---- .../apache/tuscany/sca/impl/DeployedComposite.java | 14 ++++---- .../java/org/apache/tuscany/sca/impl/NodeImpl.java | 30 ++++++++--------- .../org/apache/tuscany/sca/impl/NodeImpl2.java | 38 +++++++++++----------- .../org/apache/tuscany/sca/impl/ServiceHelper.java | 12 +++---- 5 files changed, 54 insertions(+), 54 deletions(-) (limited to 'sca-java-2.x/trunk/modules/domain-node/src/main/java/org') diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java index af0dc0df10..74e86e5421 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java @@ -44,7 +44,7 @@ import org.apache.tuscany.sca.node.configuration.ContributionConfiguration; import org.apache.tuscany.sca.node.configuration.NodeConfiguration; import org.apache.tuscany.sca.runtime.ActivationException; import org.apache.tuscany.sca.runtime.CompositeActivator; -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.RuntimeProperties; import org.apache.tuscany.sca.work.WorkScheduler; @@ -104,8 +104,8 @@ public class TuscanyRuntime { try { TuscanyRuntime runtime = newInstance(); String domain = domainURI == null ? "default" : domainURI.toString(); - EndpointRegistry endpointRegistry = runtime.domainRegistryFactory.getEndpointRegistry(domain, getDomainName(domain)); - NodeImpl node = new NodeImpl(domain, runtime.deployer, runtime.compositeActivator, endpointRegistry, runtime.extensionPointRegistry, runtime); + DomainRegistry domainRegistry = runtime.domainRegistryFactory.getEndpointRegistry(domain, getDomainName(domain)); + NodeImpl node = new NodeImpl(domain, runtime.deployer, runtime.compositeActivator, domainRegistry, runtime.extensionPointRegistry, runtime); if (dependentContributionURLs != null) { for (int i=dependentContributionURLs.length-1; i>-1; i--) { @@ -146,8 +146,8 @@ public class TuscanyRuntime { if (domainURI != null){ domainName = getDomainName(domainURI); } - EndpointRegistry endpointRegistry = domainRegistryFactory.getEndpointRegistry(domainURI, domainName); - return new NodeImpl(domainName, deployer, compositeActivator, endpointRegistry, extensionPointRegistry, null); + DomainRegistry domainRegistry = domainRegistryFactory.getEndpointRegistry(domainURI, domainName); + return new NodeImpl(domainName, deployer, compositeActivator, domainRegistry, extensionPointRegistry, null); } public NodeImpl2 createNode2(String domainURI) { @@ -155,8 +155,8 @@ public class TuscanyRuntime { if (domainURI != null){ domainName = getDomainName(domainURI); } - EndpointRegistry endpointRegistry = domainRegistryFactory.getEndpointRegistry(domainURI, domainName); - return new NodeImpl2(domainName, deployer, compositeActivator, endpointRegistry, extensionPointRegistry, null); + DomainRegistry domainRegistry = domainRegistryFactory.getEndpointRegistry(domainURI, domainName); + return new NodeImpl2(domainName, deployer, compositeActivator, domainRegistry, extensionPointRegistry, null); } /** diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java index e79590d164..3ac55ceac7 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java @@ -36,7 +36,7 @@ import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.ValidationException; import org.apache.tuscany.sca.runtime.ActivationException; import org.apache.tuscany.sca.runtime.CompositeActivator; -import org.apache.tuscany.sca.runtime.EndpointRegistry; +import org.apache.tuscany.sca.runtime.DomainRegistry; public class DeployedComposite { @@ -48,7 +48,7 @@ public class DeployedComposite { private CompositeActivator compositeActivator; private CompositeContext compositeContext; private Deployer deployer; - private EndpointRegistry endpointRegistry; + private DomainRegistry domainRegistry; private ExtensionPointRegistry extensionPointRegistry; public DeployedComposite(Composite composite, @@ -56,14 +56,14 @@ public class DeployedComposite { List dependedOnContributions, Deployer deployer, CompositeActivator compositeActivator, - EndpointRegistry endpointRegistry, + DomainRegistry domainRegistry, ExtensionPointRegistry extensionPointRegistry) throws ValidationException, ActivationException { this.composite = composite; this.contribution = contribution; this.dependedOnContributions = dependedOnContributions; this.deployer = deployer; this.compositeActivator = compositeActivator; - this.endpointRegistry = endpointRegistry; + this.domainRegistry = domainRegistry; this.extensionPointRegistry = extensionPointRegistry; try { build(); @@ -87,7 +87,7 @@ public class DeployedComposite { monitor.analyzeProblems(); compositeContext = new CompositeContext(extensionPointRegistry, - endpointRegistry, + domainRegistry, builtComposite, null, // nothing appears to use the domain name in CompositeContext null, // don't need node uri @@ -97,11 +97,11 @@ public class DeployedComposite { public void start() throws ActivationException { compositeActivator.activate(compositeContext, builtComposite); compositeActivator.start(compositeContext, builtComposite); - endpointRegistry.addRunningComposite(contribution.getURI(), builtComposite); + domainRegistry.addRunningComposite(contribution.getURI(), builtComposite); } public void stop() throws ActivationException { - endpointRegistry.removeRunningComposite(contribution.getURI(), builtComposite.getName()); + domainRegistry.removeRunningComposite(contribution.getURI(), builtComposite.getName()); compositeActivator.stop(compositeContext, builtComposite); compositeActivator.deactivate(builtComposite); } diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java index 3c0cbe4a83..a8b7cac8f3 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java @@ -70,7 +70,7 @@ import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.ValidationException; import org.apache.tuscany.sca.runtime.ActivationException; import org.apache.tuscany.sca.runtime.CompositeActivator; -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.RuntimeComponentReference; import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; @@ -82,16 +82,16 @@ public class NodeImpl implements Node { private String domainName; private Deployer deployer; private CompositeActivator compositeActivator; - private EndpointRegistry endpointRegistry; + private DomainRegistry domainRegistry; private ExtensionPointRegistry extensionPointRegistry; private TuscanyRuntime tuscanyRuntime; private Map locallyInstalledContributions = new HashMap(); - public NodeImpl(String domainName, Deployer deployer, CompositeActivator compositeActivator, EndpointRegistry endpointRegistry, ExtensionPointRegistry extensionPointRegistry, TuscanyRuntime tuscanyRuntime) { + public NodeImpl(String domainName, Deployer deployer, CompositeActivator compositeActivator, DomainRegistry domainRegistry, ExtensionPointRegistry extensionPointRegistry, TuscanyRuntime tuscanyRuntime) { this.domainName = domainName; this.deployer = deployer; this.compositeActivator = compositeActivator; - this.endpointRegistry = endpointRegistry; + this.domainRegistry = domainRegistry; this.extensionPointRegistry = extensionPointRegistry; this.tuscanyRuntime = tuscanyRuntime; } @@ -104,7 +104,7 @@ public class NodeImpl implements Node { // TODO: sort out deployables and exports org.apache.tuscany.sca.runtime.InstalledContribution ic = new org.apache.tuscany.sca.runtime.InstalledContribution(uri, contributionURL); peekIntoContribution(ic); - endpointRegistry.installContribution(ic); + domainRegistry.installContribution(ic); if (startDeployables) { for (String compositeURI : ic.getDeployables()) { start(ic.getURI(), compositeURI); @@ -222,7 +222,7 @@ public class NodeImpl implements Node { InstalledContribution ic = locallyInstalledContributions.get(contributionURI); if (ic == null) { - org.apache.tuscany.sca.runtime.InstalledContribution icx = endpointRegistry.getInstalledContribution(contributionURI); + org.apache.tuscany.sca.runtime.InstalledContribution icx = domainRegistry.getInstalledContribution(contributionURI); String url = null; if (icx != null) { url = icx.getURL(); @@ -261,10 +261,10 @@ public class NodeImpl implements Node { domainComposite.setAutowire(false); domainComposite.setLocal(false); List domainIncludes = domainComposite.getIncludes(); - Map> runningComposites = endpointRegistry.getRunningCompositeNames(); + Map> runningComposites = domainRegistry.getRunningCompositeNames(); for (String curi : runningComposites.keySet()) { for (QName name : runningComposites.get(curi)) { - domainIncludes.add(endpointRegistry.getRunningComposite(curi, name)); + domainIncludes.add(domainRegistry.getRunningComposite(curi, name)); } } return domainComposite; @@ -292,7 +292,7 @@ public class NodeImpl implements Node { } public List removeContribution(String contributionURI) throws ActivationException { - endpointRegistry.uninstallContribution(contributionURI); + domainRegistry.uninstallContribution(contributionURI); // TODO: should this next bit happen? List removedContributionURIs = new ArrayList(); @@ -345,7 +345,7 @@ public class NodeImpl implements Node { public T getService(Class interfaze, String serviceURI) throws NoSuchServiceException { - List endpoints = endpointRegistry.findEndpoint(serviceURI); + List endpoints = domainRegistry.findEndpoint(serviceURI); if (endpoints.size() < 1) { throw new NoSuchServiceException(serviceURI); } @@ -374,7 +374,7 @@ public class NodeImpl implements Node { new ExtensibleProxyFactory(extensionPointRegistry.getExtensionPoint(ProxyFactoryExtensionPoint.class)); CompositeContext compositeContext = - new CompositeContext(extensionPointRegistry, endpointRegistry, null, null, null, + new CompositeContext(extensionPointRegistry, domainRegistry, null, null, null, deployer.getSystemDefinitions()); RuntimeEndpointReference epr; @@ -481,7 +481,7 @@ public class NodeImpl implements Node { } public List getInstalledContributionURIs() { - Set ls = new HashSet(endpointRegistry.getInstalledContributionURIs()); + Set ls = new HashSet(domainRegistry.getInstalledContributionURIs()); ls.addAll(locallyInstalledContributions.keySet()); return new ArrayList(ls); } @@ -509,7 +509,7 @@ public class NodeImpl implements Node { protected void startComposite(Composite c, InstalledContribution ic) throws ActivationException, ValidationException { List dependentContributions = calculateDependentContributions(ic); - DeployedComposite dc = new DeployedComposite(c, ic.getContribution(), dependentContributions, deployer, compositeActivator, endpointRegistry, extensionPointRegistry); + DeployedComposite dc = new DeployedComposite(c, ic.getContribution(), dependentContributions, deployer, compositeActivator, domainRegistry, extensionPointRegistry); ic.start(dc); } @@ -554,8 +554,8 @@ public class NodeImpl implements Node { return uri; } - public EndpointRegistry getEndpointRegistry() { - return endpointRegistry; + public DomainRegistry getEndpointRegistry() { + return domainRegistry; } } diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java index 0091bf545f..be3838ba54 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java @@ -59,7 +59,7 @@ import org.apache.tuscany.sca.monitor.ValidationException; import org.apache.tuscany.sca.runtime.ActivationException; import org.apache.tuscany.sca.runtime.CompositeActivator; import org.apache.tuscany.sca.runtime.ContributionListener; -import org.apache.tuscany.sca.runtime.EndpointRegistry; +import org.apache.tuscany.sca.runtime.DomainRegistry; import org.apache.tuscany.sca.runtime.InstalledContribution; import org.oasisopen.sca.NoSuchServiceException; @@ -68,7 +68,7 @@ public class NodeImpl2 { private String domainName; private Deployer deployer; private CompositeActivator compositeActivator; - private EndpointRegistry endpointRegistry; + private DomainRegistry domainRegistry; private ExtensionPointRegistry extensionPointRegistry; private TuscanyRuntime tuscanyRuntime; @@ -80,17 +80,17 @@ public class NodeImpl2 { public NodeImpl2(String domainName, Deployer deployer, CompositeActivator compositeActivator, - EndpointRegistry endpointRegistry, + DomainRegistry domainRegistry, ExtensionPointRegistry extensionPointRegistry, TuscanyRuntime tuscanyRuntime) { this.domainName = domainName; this.deployer = deployer; this.compositeActivator = compositeActivator; - this.endpointRegistry = endpointRegistry; + this.domainRegistry = domainRegistry; this.extensionPointRegistry = extensionPointRegistry; this.tuscanyRuntime = tuscanyRuntime; - endpointRegistry.addContributionListener(new ContributionListener() { + domainRegistry.addContributionListener(new ContributionListener() { public void contributionUpdated(String uri) { loadedContributions.remove(uri); } @@ -121,13 +121,13 @@ public class NodeImpl2 { peekIntoContribution(ic); - endpointRegistry.installContribution(ic); + domainRegistry.installContribution(ic); return ic.getURI(); } public void uninstallContribution(String contributionURI) { - endpointRegistry.uninstallContribution(contributionURI); + domainRegistry.uninstallContribution(contributionURI); } protected void mergeContributionMetaData(String metaDataURL, Contribution contribution) throws ValidationException { @@ -180,7 +180,7 @@ public class NodeImpl2 { } public List getInstalledContributionURIs() { - return new ArrayList(endpointRegistry.getInstalledContributionURIs()); + return new ArrayList(domainRegistry.getInstalledContributionURIs()); } public Contribution getContribution(String contributionURI) throws ContributionReadException, ValidationException { @@ -188,7 +188,7 @@ public class NodeImpl2 { } public List getDeployableCompositeURIs(String contributionURI) { - InstalledContribution ic = endpointRegistry.getInstalledContribution(contributionURI); + InstalledContribution ic = domainRegistry.getInstalledContribution(contributionURI); return new ArrayList(ic.getDeployables()); } @@ -220,7 +220,7 @@ public class NodeImpl2 { composite.setURI(composite.getName().getLocalPart() + ".composite"); } ic.getAdditionalDeployables().put(composite.getURI(), compositeToXML(composite)); - endpointRegistry.updateInstalledContribution(ic); + domainRegistry.updateInstalledContribution(ic); } public void validateContribution(String contributionURI) throws ContributionReadException, ValidationException { @@ -243,7 +243,7 @@ public class NodeImpl2 { } public Map> getStartedComposites() { - return endpointRegistry.getRunningCompositeNames(); + return domainRegistry.getRunningCompositeNames(); } public void startComposite(String contributionURI, String compositeURI) throws ActivationException, ValidationException, ContributionReadException { @@ -260,7 +260,7 @@ public class NodeImpl2 { Contribution contribution = loadContribution(ic); Composite composite = contribution.getArtifactModel(compositeURI); List dependentContributions = calculateDependentContributions(ic); - dc = new DeployedComposite(composite, contribution, dependentContributions, deployer, compositeActivator, endpointRegistry, extensionPointRegistry); + dc = new DeployedComposite(composite, contribution, dependentContributions, deployer, compositeActivator, domainRegistry, extensionPointRegistry); dc.start(); startedComposites.put(key, dc); } @@ -288,21 +288,21 @@ public class NodeImpl2 { domainComposite.setAutowire(false); domainComposite.setLocal(false); List domainIncludes = domainComposite.getIncludes(); - Map> runningComposites = endpointRegistry.getRunningCompositeNames(); + Map> runningComposites = domainRegistry.getRunningCompositeNames(); for (String curi : runningComposites.keySet()) { for (QName name : runningComposites.get(curi)) { - domainIncludes.add(endpointRegistry.getRunningComposite(curi, name)); + domainIncludes.add(domainRegistry.getRunningComposite(curi, name)); } } return domainComposite; } public T getService(Class interfaze, String serviceURI) throws NoSuchServiceException { - return ServiceHelper.getService(interfaze, serviceURI, endpointRegistry, extensionPointRegistry, deployer); + return ServiceHelper.getService(interfaze, serviceURI, domainRegistry, extensionPointRegistry, deployer); } protected InstalledContribution getInstalledContribution(String contributionURI) { - InstalledContribution ic = endpointRegistry.getInstalledContribution(contributionURI); + InstalledContribution ic = domainRegistry.getInstalledContribution(contributionURI); if (ic == null) { throw new IllegalArgumentException("Contribution not installed: " + contributionURI); } @@ -338,7 +338,7 @@ public class NodeImpl2 { if (ic.getDependentContributionURIs() != null && ic.getDependentContributionURIs().size() > 0) { // if the install specified dependent uris use just those contributions for (String uri : ic.getDependentContributionURIs()) { - InstalledContribution dependee = endpointRegistry.getInstalledContribution(uri); + InstalledContribution dependee = domainRegistry.getInstalledContribution(uri); if (dependee != null) { dependentContributions.add(loadContribution(dependee)); } @@ -357,8 +357,8 @@ public class NodeImpl2 { private List findExportingContributions(Import imprt) { List ics = new ArrayList(); // TODO: Handle Imports in a more extensible way - for (String curi : endpointRegistry.getInstalledContributionURIs()) { - InstalledContribution ic = endpointRegistry.getInstalledContribution(curi); + for (String curi : domainRegistry.getInstalledContributionURIs()) { + InstalledContribution ic = domainRegistry.getInstalledContribution(curi); if (imprt instanceof JavaImport) { for (String s : ic.getJavaExports()) { if (s.startsWith(((JavaImport)imprt).getPackage())) { diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/ServiceHelper.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/ServiceHelper.java index ffb3281ebc..42a550d543 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/ServiceHelper.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/ServiceHelper.java @@ -41,7 +41,7 @@ import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; import org.apache.tuscany.sca.interfacedef.java.JavaInterface; import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; -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.RuntimeComponentReference; import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; @@ -55,9 +55,9 @@ import org.oasisopen.sca.ServiceRuntimeException; */ public class ServiceHelper { - public static T getService(Class interfaze, String serviceURI, EndpointRegistry endpointRegistry, ExtensionPointRegistry extensionPointRegistry, Deployer deployer) throws NoSuchServiceException { + public static T getService(Class interfaze, String serviceURI, DomainRegistry domainRegistry, ExtensionPointRegistry extensionPointRegistry, Deployer deployer) throws NoSuchServiceException { - List endpoints = endpointRegistry.findEndpoint(serviceURI); + List endpoints = domainRegistry.findEndpoint(serviceURI); if (endpoints.size() < 1) { throw new NoSuchServiceException(serviceURI); } @@ -74,11 +74,11 @@ public class ServiceHelper { if (((RuntimeComponent)ep.getComponent()).getComponentContext() != null) { return ((RuntimeComponent)ep.getComponent()).getServiceReference(interfaze, serviceName).getService(); } else { - return getRemoteProxy(interfaze, ep, endpointRegistry, extensionPointRegistry, deployer); + return getRemoteProxy(interfaze, ep, domainRegistry, extensionPointRegistry, deployer); } } - private static T getRemoteProxy(Class serviceInterface, Endpoint endpoint, EndpointRegistry endpointRegistry, ExtensionPointRegistry extensionPointRegistry, Deployer deployer) throws NoSuchServiceException { + private static T getRemoteProxy(Class serviceInterface, Endpoint endpoint, DomainRegistry domainRegistry, ExtensionPointRegistry extensionPointRegistry, Deployer deployer) throws NoSuchServiceException { FactoryExtensionPoint factories = extensionPointRegistry.getExtensionPoint(FactoryExtensionPoint.class); AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class); JavaInterfaceFactory javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class); @@ -86,7 +86,7 @@ public class ServiceHelper { new ExtensibleProxyFactory(extensionPointRegistry.getExtensionPoint(ProxyFactoryExtensionPoint.class)); CompositeContext compositeContext = - new CompositeContext(extensionPointRegistry, endpointRegistry, null, null, null, + new CompositeContext(extensionPointRegistry, domainRegistry, null, null, null, deployer.getSystemDefinitions()); RuntimeEndpointReference epr; -- cgit v1.2.3