summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/domain-node/src/main
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-11-25 14:16:34 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-11-25 14:16:34 +0000
commitab1d1e59f05a13e13c9621afd2b5393092fd99c9 (patch)
treeaa9ef0498cabfcdf5f339c1c147c93f42a81e4a0 /sca-java-2.x/trunk/modules/domain-node/src/main
parentd163c0274c828c0caa9c261d06a5e6284b3d4dcf (diff)
Add a new helloworld sample as a plain sca contribution, and itest for the helloworld sample, and a fix to DomainNode so it works with that in a standalone domain
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@884111 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/main')
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java
index 135c6a79c7..ad85899aaa 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java
@@ -30,6 +30,7 @@ import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.node.Node;
import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
import org.apache.tuscany.sca.node.impl.NodeImpl;
import org.apache.tuscany.sca.runtime.DomainRegistryFactory;
import org.apache.tuscany.sca.runtime.EndpointRegistry;
@@ -60,7 +61,7 @@ public class DomainNode {
public DomainNode(String configURI, String[] contributionLocations) {
this.domainRegistryURI = configURI;
initDomainName(configURI);
- nodeFactory = NodeFactory.getInstance(domainRegistryURI);
+ nodeFactory = NodeFactory.getInstance(domainName);
for (String loc : contributionLocations) {
addContribution(loc);
}
@@ -82,7 +83,12 @@ public class DomainNode {
if (nodes.containsKey(uri)) {
throw new IllegalArgumentException("contribution already added: " + uri);
}
- Node node = nodeFactory.createNode((String)null, new String[] {uri}, new String[] {location}).start();
+ NodeConfiguration configuration = nodeFactory.createNodeConfiguration();
+ configuration.addContribution(uri, location);
+ configuration.setDomainRegistryURI(domainRegistryURI);
+ configuration.setDomainURI(domainName);
+ configuration.setURI(uri); //???
+ Node node = nodeFactory.createNode(configuration).start();
nodes.put(uri, node);
}
@@ -127,19 +133,19 @@ public class DomainNode {
public <T> T getService(Class<T> interfaze, String uri) throws NoSuchServiceException {
try {
- return SCAClientFactory.newInstance(URI.create(getDomainConfigURI())).getService(interfaze, uri);
+ return SCAClientFactory.newInstance(URI.create(getDomainName())).getService(interfaze, uri);
} catch (NoSuchDomainException e) {
throw new IllegalStateException(e);
}
}
protected void initDomainName(String configURI) {
- URI uri = URI.create(fixScheme(configURI));
- String dn = uri.getHost();
- if (dn == null || dn.length() < 1) {
- dn = DEFAULT_DOMAIN_NAME;
- }
- domainName = dn;
+// URI uri = URI.create(fixScheme(configURI));
+// String dn = uri.getHost();
+// if (dn == null || dn.length() < 1) {
+// dn = DEFAULT_DOMAIN_NAME;
+// }
+ domainName = configURI;
}
/**