summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-06-13 21:39:56 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-06-13 21:39:56 +0000
commit5695a53ee03f7e92d426dfc650f11ef45e630bdc (patch)
tree1cee40fc816b0476f2b45e2e268ff5f46dd9f34f /sca-java-2.x/trunk/modules
parent3b4a10eca44bf3d579a5e1260fcf823cf52fd045 (diff)
Update for to use the domain uri and name from the registry and to use the domain name in the binding base uri for non-default domains
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1135297 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java4
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java4
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java11
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/DependencyUtilsTestCase.java1
4 files changed, 8 insertions, 12 deletions
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 149599b8fd..4dbccfbe28 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
@@ -104,7 +104,7 @@ public class TuscanyRuntime {
TuscanyRuntime runtime = newInstance();
String domain = domainURI == null ? "default" : domainURI.toString();
DomainRegistry domainRegistry = runtime.domainRegistryFactory.getEndpointRegistry(domain, getDomainName(domain));
- NodeImpl node = new NodeImpl(domain, runtime.deployer, runtime.compositeActivator, domainRegistry, runtime.extensionPointRegistry, runtime);
+ NodeImpl node = new NodeImpl(runtime.deployer, runtime.compositeActivator, domainRegistry, runtime.extensionPointRegistry, runtime);
if (dependentContributionURLs != null) {
for (int i=dependentContributionURLs.length-1; i>-1; i--) {
@@ -150,7 +150,7 @@ public class TuscanyRuntime {
domainName = getDomainName(domainURI);
}
DomainRegistry domainRegistry = domainRegistryFactory.getEndpointRegistry(domainURI, domainName);
- return new NodeImpl(domainName, deployer, compositeActivator, domainRegistry, extensionPointRegistry, null);
+ return new NodeImpl(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 ce3713324c..e8315b74f0 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
@@ -88,8 +88,8 @@ public class DeployedComposite {
// TODO: don't hardcode the default domain name, instead do something like having a property on Node that says whether or not the
// domain name should be included in the service uri
- if (!"default".equals(domainRegistry.getDomainURI())) {
- bs.put(new QName("default"), Arrays.asList(new String[]{domainRegistry.getDomainURI()}));
+ if (!"default".equals(domainRegistry.getDomainName())) {
+ bs.put(new QName("default"), Arrays.asList(new String[]{domainRegistry.getDomainName()}));
}
builtComposite = deployer.build(contributions, dependedOnContributions, bs, monitor);
// TODO: Ideally deployer.build would set the name and uri to what this needs
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 00eb2e7e06..0a840aa66f 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
@@ -57,7 +57,6 @@ import org.oasisopen.sca.NoSuchServiceException;
public class NodeImpl implements Node {
- private String domainName;
private Deployer deployer;
private CompositeActivator compositeActivator;
private DomainRegistry domainRegistry;
@@ -69,13 +68,11 @@ public class NodeImpl implements Node {
private Map<String, DeployedComposite> startedComposites = new HashMap<String, DeployedComposite>();
private Map<String, DeployedComposite> stoppedComposites = new HashMap<String, DeployedComposite>();
- public NodeImpl(String domainName,
- Deployer deployer,
+ public NodeImpl(Deployer deployer,
CompositeActivator compositeActivator,
DomainRegistry domainRegistry,
ExtensionPointRegistry extensionPointRegistry,
TuscanyRuntime tuscanyRuntime) {
- this.domainName = domainName;
this.deployer = deployer;
this.compositeActivator = compositeActivator;
this.domainRegistry = domainRegistry;
@@ -250,7 +247,7 @@ public class NodeImpl implements Node {
@Override
public void startComposite(String contributionURI, String compositeURI, String nodeName) throws ActivationException {
- String response = domainRegistry.remoteCommand(nodeName, new RemoteCommand(domainName, "start", contributionURI, compositeURI));
+ String response = domainRegistry.remoteCommand(nodeName, new RemoteCommand(domainRegistry.getDomainName(), "start", contributionURI, compositeURI));
if (!"Started.".equals(response)) {
throw new ActivationException(response);
}
@@ -269,7 +266,7 @@ public class NodeImpl implements Node {
if (member == null) {
throw new IllegalStateException("composite not started: " + compositeURI);
}
- RemoteCommand command = new RemoteCommand(domainName, "stop", contributionURI, compositeURI);
+ RemoteCommand command = new RemoteCommand(domainRegistry.getDomainName(), "stop", contributionURI, compositeURI);
String response = domainRegistry.remoteCommand(member, command);
if (!"Stopped.".equals(response)) {
throw new ActivationException(response);
@@ -278,7 +275,7 @@ public class NodeImpl implements Node {
}
public String getDomainName() {
- return domainName;
+ return domainRegistry.getDomainName();
}
public Composite getDomainComposite() {
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/DependencyUtilsTestCase.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/DependencyUtilsTestCase.java
index c169fb9808..a2e6abd893 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/DependencyUtilsTestCase.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/DependencyUtilsTestCase.java
@@ -58,5 +58,4 @@ public class DependencyUtilsTestCase {
contributions.put("unrelated", new ZipInputStream(new BufferedInputStream(new FileInputStream("src/test/resources/sample-helloworld-nodeployable.jar"))));
return contributions;
}
-
}