summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java38
-rw-r--r--sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java6
-rw-r--r--sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java79
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/Node.java8
-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.java14
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java16
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java8
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java4
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java18
-rw-r--r--sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedDomainRegistry.java6
-rw-r--r--sca-java-2.x/trunk/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java6
-rw-r--r--sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java14
13 files changed, 108 insertions, 113 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java
index 994783b928..7705ceab02 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java
@@ -28,8 +28,6 @@ import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
-import javax.xml.namespace.QName;
-
import org.apache.tuscany.sca.assembly.Binding;
import org.apache.tuscany.sca.assembly.Composite;
import org.apache.tuscany.sca.assembly.Endpoint;
@@ -38,8 +36,8 @@ import org.apache.tuscany.sca.core.LifeCycleListener;
import org.apache.tuscany.sca.core.UtilityExtensionPoint;
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.DomainRegistry;
+import org.apache.tuscany.sca.runtime.EndpointListener;
import org.apache.tuscany.sca.runtime.InstalledContribution;
import org.apache.tuscany.sca.runtime.RuntimeProperties;
@@ -50,7 +48,7 @@ public class DomainRegistryImpl extends BaseDomainRegistry implements DomainRegi
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>>();
+ private Map<String, Map<String, Composite>> runningComposites = new HashMap<String, Map<String, Composite>>();
private Map<String, InstalledContribution> installedContributions = new HashMap<String, InstalledContribution>();
protected boolean quietLogging;
@@ -165,41 +163,41 @@ public class DomainRegistryImpl extends BaseDomainRegistry implements DomainRegi
}
public void addRunningComposite(String curi, Composite composite) {
- Map<QName, Composite> cs = runningComposites.get(curi);
+ Map<String, Composite> cs = runningComposites.get(curi);
if (cs == null) {
- cs = new HashMap<QName, Composite>();
+ cs = new HashMap<String, Composite>();
runningComposites.put(curi, cs);
}
- cs.put(composite.getName(), composite);
+ cs.put(composite.getURI(), composite);
}
- public void removeRunningComposite(String curi, QName name) {
- Map<QName, Composite> cs = runningComposites.get(curi);
+ public void removeRunningComposite(String curi, String compositeURI) {
+ Map<String, Composite> cs = runningComposites.get(curi);
if (cs != null) {
- cs.remove(name);
+ cs.remove(compositeURI);
}
}
- public Composite getRunningComposite(String curi, QName name) {
- Map<QName, Composite> cs = runningComposites.get(curi);
+ public Composite getRunningComposite(String curi, String compositeURI) {
+ Map<String, Composite> cs = runningComposites.get(curi);
if (cs != null) {
- return cs.get(name);
+ return cs.get(compositeURI);
}
return null;
}
- public Map<String, List<QName>> getRunningCompositeNames() {
- Map<String, List<QName>> compositeNames = new HashMap<String, List<QName>>();
+ public Map<String, List<String>> getRunningCompositeURIs() {
+ Map<String, List<String>> compositeURIs = new HashMap<String, List<String>>();
for (String curi : runningComposites.keySet()) {
if (runningComposites.get(curi).size() > 0) {
- List<QName> names = new ArrayList<QName>();
- compositeNames.put(curi, names);
- for (QName qn : runningComposites.get(curi).keySet()) {
- names.add(qn);
+ List<String> uris = new ArrayList<String>();
+ compositeURIs.put(curi, uris);
+ for (String uri : runningComposites.get(curi).keySet()) {
+ uris.add(uri);
}
}
}
- return compositeNames;
+ return compositeURIs;
}
public void installContribution(InstalledContribution ic) {
diff --git a/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java b/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
index 890e95ccff..d72f22ae63 100644
--- a/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
+++ b/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
@@ -863,14 +863,14 @@ public class DeployerImpl implements Deployer {
public void addRunningComposite(String contributionURI, Composite composite) {
}
- public void removeRunningComposite(String contributionURI, QName name) {
+ public void removeRunningComposite(String contributionURI, String compositeURI) {
}
- public Composite getRunningComposite(String contributionURI, QName name) {
+ public Composite getRunningComposite(String contributionURI, String compositeURI) {
return null;
}
- public Map<String, List<QName>> getRunningCompositeNames() {
+ public Map<String, List<String>> getRunningCompositeURIs() {
return null;
}
diff --git a/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java b/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java
index f74375eca3..73c6409272 100644
--- a/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java
+++ b/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java
@@ -38,7 +38,6 @@ import javax.wsdl.Definition;
import javax.wsdl.WSDLException;
import javax.wsdl.xml.WSDLReader;
import javax.wsdl.xml.WSDLWriter;
-import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
@@ -96,8 +95,10 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai
protected Map<Object, Object> endpointMap;
protected MultiMap<String, String> endpointOwners;
- protected Map<String, Map<QName, String>> runningComposites;
- protected Map<String, Map<String, List<QName>>> runningCompositeOwners;
+
+ // key contributionURI, value map key compositeURI value compositeXML
+ protected Map<String, Map<String, String>> runningComposites;
+ protected Map<String, Map<String, List<String>>> runningCompositeOwners;
protected Map<Object, Object> endpointWsdls;
protected Map<String, Endpoint> localEndpoints = new ConcurrentHashMap<String, Endpoint>();
@@ -470,11 +471,11 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai
}
}
if (runningCompositeOwners.containsKey(memberAddr)) {
- Map<String, List<QName>> cs = runningCompositeOwners.remove(memberAddr);
+ Map<String, List<String>> cs = runningCompositeOwners.remove(memberAddr);
for (String curi : cs.keySet()) {
- Map<QName, String> rcs = runningComposites.get(curi);
- for (QName qn : cs.get(curi)) {
- rcs.remove(qn);
+ Map<String, String> rcs = runningComposites.get(curi);
+ for (String uri : cs.get(curi)) {
+ rcs.remove(uri);
}
}
}
@@ -514,47 +515,47 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai
String localMemberAddr = hazelcastInstance.getCluster().getLocalMember().getInetSocketAddress().toString();
String compositeXML = writeComposite(composite);
// TODO: doing this in a txn causes the values to get lost - looks like a bug in hazelcast
-// Transaction txn = hazelcastInstance.getTransaction();
-// txn.begin();
-// try {
- Map<QName, String> cs = runningComposites.get(curi);
+ Transaction txn = hazelcastInstance.getTransaction();
+ txn.begin();
+ try {
+ Map<String, String> cs = runningComposites.get(curi);
if (cs == null) {
- cs = new HashMap<QName, String>();
+ cs = new HashMap<String, String>();
}
- cs.put(composite.getName(), compositeXML);
+ cs.put(composite.getURI(), compositeXML);
runningComposites.put(curi, cs);
- Map<String, List<QName>> ocs = runningCompositeOwners.get(localMemberAddr);
+ Map<String, List<String>> ocs = runningCompositeOwners.get(localMemberAddr);
if (ocs == null) {
- ocs = new HashMap<String, List<QName>>();
+ ocs = new HashMap<String, List<String>>();
}
- List<QName> lcs = ocs.get(curi);
+ List<String> lcs = ocs.get(curi);
if (lcs == null) {
- lcs = new ArrayList<QName>();
+ lcs = new ArrayList<String>();
ocs.put(curi, lcs);
}
- lcs.add(composite.getName());
+ lcs.add(composite.getURI());
runningCompositeOwners.put(localMemberAddr, ocs);
-// txn.commit();
-// } catch (Throwable e) {
-// txn.rollback();
-// throw new ServiceRuntimeException(e);
-// }
+ txn.commit();
+ } catch (Throwable e) {
+ txn.rollback();
+ throw new ServiceRuntimeException(e);
+ }
}
- public void removeRunningComposite(String curi, QName name) {
+ public void removeRunningComposite(String curi, String compositeURI) {
String localMemberAddr = hazelcastInstance.getCluster().getLocalMember().getInetSocketAddress().toString();
Transaction txn = hazelcastInstance.getTransaction();
txn.begin();
try {
- Map<QName, String> cs = runningComposites.get(curi);
+ Map<String, String> cs = runningComposites.get(curi);
if (cs != null) {
- cs.remove(name);
+ cs.remove(compositeURI);
}
- Map<String, List<QName>> ocs = runningCompositeOwners.get(localMemberAddr);
+ Map<String, List<String>> ocs = runningCompositeOwners.get(localMemberAddr);
if (ocs != null) {
- List<QName> xya = ocs.get(curi);
+ List<String> xya = ocs.get(curi);
if (xya != null) {
- xya.remove(name);
+ xya.remove(compositeURI);
}
}
txn.commit();
@@ -564,23 +565,23 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai
}
}
- public Map<String, List<QName>> getRunningCompositeNames() {
- Map<String, List<QName>> compositeNames = new HashMap<String, List<QName>>();
+ public Map<String, List<String>> getRunningCompositeURIs() {
+ Map<String, List<String>> compositeURIs = new HashMap<String, List<String>>();
for (String curi : runningComposites.keySet()) {
- List<QName> names = new ArrayList<QName>();
- compositeNames.put(curi, names);
- for (QName qn : runningComposites.get(curi).keySet()) {
- names.add(qn);
+ List<String> uris = new ArrayList<String>();
+ compositeURIs.put(curi, uris);
+ for (String uri : runningComposites.get(curi).keySet()) {
+ uris.add(uri);
}
}
- return compositeNames;
+ return compositeURIs;
}
@Override
- public Composite getRunningComposite(String contributionURI, QName name) {
- Map<QName, String> cs = runningComposites.get(contributionURI);
+ public Composite getRunningComposite(String contributionURI, String compositeURI) {
+ Map<String, String> cs = runningComposites.get(contributionURI);
if (cs != null) {
- String compositeXML = cs.get(name);
+ String compositeXML = cs.get(compositeURI);
return readComposite(compositeXML);
}
return null;
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/Node.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/Node.java
index a5125332fe..7cb76f4a76 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/Node.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/Node.java
@@ -216,12 +216,10 @@ public interface Node {
<T> T getService(Class<T> interfaze, String serviceURI) throws NoSuchServiceException;
/**
- * Get the URIs of any composites that have been started for a contribution
- * @param contributionURI the contribution URI
- * @return the List of started composite URIs
+ * Get the URIs of any composites that have been started in the domain
+ * @return a map with key contributionURI and value a list of the started compositeURIs
*/
-// List<String> getStartedCompositeURIs(String contributionURI);
- Map<String, List<QName>> getStartedComposites();
+ Map<String, List<String>> getStartedCompositeURIs();
/**
* Get the URIs of all the contributions installed on this Node
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 3ac55ceac7..5a72906e1e 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
@@ -83,7 +83,9 @@ public class DeployedComposite {
Monitor monitor = deployer.createMonitor();
builtComposite = deployer.build(contributions, dependedOnContributions, new HashMap<QName, List<String>>(), monitor);
+ // TODO: Ideally deployer.build would set the name and uri to what this needs
builtComposite.setName(composite.getName());
+ builtComposite.setURI(composite.getURI());
monitor.analyzeProblems();
compositeContext = new CompositeContext(extensionPointRegistry,
@@ -101,7 +103,7 @@ public class DeployedComposite {
}
public void stop() throws ActivationException {
- domainRegistry.removeRunningComposite(contribution.getURI(), builtComposite.getName());
+ domainRegistry.removeRunningComposite(contribution.getURI(), builtComposite.getURI());
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 da531a4453..4e821734ce 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
@@ -22,6 +22,7 @@ package org.apache.tuscany.sca.impl;
import java.io.Reader;
import java.io.StringReader;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -218,9 +219,8 @@ public class NodeImpl implements Node {
}
}
- // TODO: should this be composite uri instead of QName?
- public Map<String, List<QName>> getStartedComposites() {
- return domainRegistry.getRunningCompositeNames();
+ public Map<String, List<String>> getStartedCompositeURIs() {
+ return Collections.unmodifiableMap(domainRegistry.getRunningCompositeURIs());
}
public void startComposite(String contributionURI, String compositeURI) throws ActivationException, ValidationException, ContributionReadException {
@@ -265,10 +265,10 @@ public class NodeImpl implements Node {
domainComposite.setAutowire(false);
domainComposite.setLocal(false);
List<Composite> domainIncludes = domainComposite.getIncludes();
- Map<String, List<QName>> runningComposites = domainRegistry.getRunningCompositeNames();
- for (String curi : runningComposites.keySet()) {
- for (QName name : runningComposites.get(curi)) {
- domainIncludes.add(domainRegistry.getRunningComposite(curi, name));
+ Map<String, List<String>> runningCompositeURIs = domainRegistry.getRunningCompositeURIs();
+ for (String curi : runningCompositeURIs.keySet()) {
+ for (String compositeURI : runningCompositeURIs.get(curi)) {
+ domainIncludes.add(domainRegistry.getRunningComposite(curi, compositeURI));
}
}
return domainComposite;
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java
index 17963d97c9..dcb35995a8 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java
@@ -143,7 +143,7 @@ public class Node2TestCase {
node.installContribution("src/test/resources/export.jar");
node.validateContribution("import");
node.startComposite("import", "helloworld.composite");
- Map<String, List<QName>> scs = node.getStartedComposites();
+ Map<String, List<String>> scs = node.getStartedCompositeURIs();
Assert.assertEquals(1, scs.size());
}
@@ -160,7 +160,7 @@ public class Node2TestCase {
nodeB.installContribution("src/test/resources/export.jar");
nodeA.validateContribution("import");
nodeA.startComposite("import", "helloworld.composite");
- Map<String, List<QName>> scs = nodeB.getStartedComposites();
+ Map<String, List<String>> scs = nodeB.getStartedCompositeURIs();
Assert.assertEquals(1, scs.size());
}
@@ -168,17 +168,17 @@ public class Node2TestCase {
public void startTest() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
Node node = TuscanyRuntime.newInstance().createNode("ImportTestCase");
node.installContribution("src/test/resources/sample-helloworld.jar");
- Assert.assertEquals(0, node.getStartedComposites().size());
+ Assert.assertEquals(0, node.getStartedCompositeURIs().size());
node.startComposite("sample-helloworld", "helloworld.composite");
- Assert.assertEquals(1, node.getStartedComposites().size());
- Assert.assertEquals("helloworld", node.getStartedComposites().get("sample-helloworld").get(0).getLocalPart());
+ Assert.assertEquals(1, node.getStartedCompositeURIs().size());
+ Assert.assertEquals("helloworld.composite", node.getStartedCompositeURIs().get("sample-helloworld").get(0));
node.stopComposite("sample-helloworld", "helloworld.composite");
// Assert.assertEquals(0, node.getStartedComposites().size());
node.startComposite("sample-helloworld", "helloworld.composite");
- Assert.assertEquals(1, node.getStartedComposites().size());
- Assert.assertEquals("helloworld", node.getStartedComposites().get("sample-helloworld").get(0).getLocalPart());
+ Assert.assertEquals(1, node.getStartedCompositeURIs().size());
+ Assert.assertEquals("helloworld.composite", node.getStartedCompositeURIs().get("sample-helloworld").get(0));
node.stopComposite("sample-helloworld", "helloworld.composite");
}
@@ -199,7 +199,7 @@ public class Node2TestCase {
String compositeURI = node.addDeploymentComposite(curi, new StringReader(compositeXML));
node.startComposite(curi, compositeURI);
- Assert.assertEquals(1, node.getStartedComposites().size());
+ Assert.assertEquals(1, node.getStartedCompositeURIs().size());
Composite dc = node.getDomainComposite();
Assert.assertEquals(1, dc.getIncludes().size());
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java
index 8713d0b478..f32ff81625 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java
@@ -74,9 +74,9 @@ public class DeployerTestCase {
monitor.analyzeProblems();
String cmpuri = node.addDeploymentComposite("foo", composite);
node.startComposite("foo", cmpuri);
- Map<String, List<QName>> dcs = node.getStartedComposites();
+ Map<String, List<String>> dcs = node.getStartedCompositeURIs();
Assert.assertEquals(1, dcs.size());
- Assert.assertEquals("helloworld2", dcs.get("foo").get(0).getLocalPart());
+ Assert.assertEquals("helloworld2.composite", dcs.get("foo").get(0));
}
@Test
@@ -88,9 +88,9 @@ public class DeployerTestCase {
String cmpuri = node.addDeploymentComposite("foo", new FileReader(new File("src/test/resources/helloworld2.composite")));
node.startComposite("foo", cmpuri);
- Map<String, List<QName>> dcs = node.getStartedComposites();
+ Map<String, List<String>> dcs = node.getStartedCompositeURIs();
Assert.assertEquals(1, dcs.size());
- Assert.assertEquals("helloworld2", dcs.get("foo").get(0).getLocalPart());
+ Assert.assertEquals("helloworld2.composite", dcs.get("foo").get(0));
}
}
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java
index ca4ea32c4d..c7041fa5b4 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java
@@ -40,9 +40,9 @@ public class NodeXMLTestCase {
List<String> cs = node.getInstalledContributionURIs();
Assert.assertEquals(1, cs.size());
Assert.assertEquals("sample-helloworld", cs.get(0));
- Map<String, List<QName>> startedComposites = node.getStartedComposites();
+ Map<String, List<String>> startedComposites = node.getStartedCompositeURIs();
Assert.assertEquals(1, startedComposites.size());
- Assert.assertEquals("helloworld", startedComposites.get("sample-helloworld").get(0).getLocalPart());
+ Assert.assertEquals("helloworld.composite", startedComposites.get("sample-helloworld").get(0));
}
}
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java
index 55d164c56e..4aa50447ad 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java
@@ -57,7 +57,7 @@ public class TuscanyRuntimeTestCase {
node.installContribution("helloworld", "src/test/resources/sample-helloworld.jar", null, null);
node.startComposite("helloworld", "helloworld.composite");
- Map<String, List<QName>> ci = node.getStartedComposites();
+ Map<String, List<String>> ci = node.getStartedCompositeURIs();
Assert.assertEquals(1, ci.size());
Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
@@ -130,10 +130,10 @@ public class TuscanyRuntimeTestCase {
node.installContribution("foo", "src/test/resources/sample-helloworld.jar", null, null);
List<String> dcs = node.startDeployables("foo");
Assert.assertEquals(1, dcs.size());
- Map<String, List<QName>> dcsx = node.getStartedComposites();
+ Map<String, List<String>> dcsx = node.getStartedCompositeURIs();
Assert.assertEquals(1, dcsx.size());
node.stopComposite("foo", "helloworld.composite");
- dcsx = node.getStartedComposites();
+ dcsx = node.getStartedCompositeURIs();
Assert.assertEquals(0, dcsx.size());
}
@@ -143,9 +143,9 @@ public class TuscanyRuntimeTestCase {
node.installContribution("helloworld", "src/test/resources/sample-helloworld-nodeployable.jar", "src/test/resources/sca-contribution-generated.xml", null);
node.startComposite("helloworld", "helloworld.composite");
- Map<String, List<QName>> dcs = node.getStartedComposites();
+ Map<String, List<String>> dcs = node.getStartedCompositeURIs();
Assert.assertEquals(1, dcs.size());
- Assert.assertEquals("helloworld", dcs.get("helloworld").get(0).getLocalPart());
+ Assert.assertEquals("helloworld.composite", dcs.get("helloworld").get(0));
Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
@@ -163,9 +163,9 @@ public class TuscanyRuntimeTestCase {
Node node = TuscanyRuntime.runComposite("helloworld.composite", "src/test/resources/sample-helloworld.jar");
List<String> cs = node.getInstalledContributionURIs();
Assert.assertEquals(1, cs.size());
- Map<String, List<QName>> dcs = node.getStartedComposites();
+ Map<String, List<String>> dcs = node.getStartedCompositeURIs();
Assert.assertEquals(1, dcs.size());
- Assert.assertEquals("helloworld", dcs.get("sample-helloworld").get(0).getLocalPart());
+ Assert.assertEquals("helloworld.composite", dcs.get("sample-helloworld").get(0));
}
@Test
@@ -173,9 +173,9 @@ public class TuscanyRuntimeTestCase {
Node node = TuscanyRuntime.runComposite(null, "src/test/resources/sample-helloworld.jar");
List<String> cs = node.getInstalledContributionURIs();
Assert.assertEquals(1, cs.size());
- Map<String, List<QName>> dcs = node.getStartedComposites();
+ Map<String, List<String>> dcs = node.getStartedCompositeURIs();
Assert.assertEquals(1, dcs.size());
- Assert.assertEquals("helloworld", dcs.get("sample-helloworld").get(0).getLocalPart());
+ Assert.assertEquals("helloworld.composite", dcs.get("sample-helloworld").get(0));
}
@Test
public void testRunComposite() throws NoSuchServiceException {
diff --git a/sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedDomainRegistry.java b/sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedDomainRegistry.java
index e94b710186..9a6f362cb6 100644
--- a/sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedDomainRegistry.java
+++ b/sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedDomainRegistry.java
@@ -452,19 +452,19 @@ public class ReplicatedDomainRegistry extends BaseDomainRegistry implements Doma
}
@Override
- public void removeRunningComposite(String contributionURI, QName name) {
+ public void removeRunningComposite(String contributionURI, String compositeURI) {
// TODO Auto-generated method stub
}
@Override
- public Composite getRunningComposite(String contributionURI, QName name) {
+ public Composite getRunningComposite(String contributionURI, String compositeURI) {
// TODO Auto-generated method stub
return null;
}
@Override
- public Map<String, List<QName>> getRunningCompositeNames() {
+ public Map<String, List<String>> getRunningCompositeURIs() {
// TODO Auto-generated method stub
return null;
}
diff --git a/sca-java-2.x/trunk/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java b/sca-java-2.x/trunk/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
index b72d8e5de3..96d2119b87 100644
--- a/sca-java-2.x/trunk/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
+++ b/sca-java-2.x/trunk/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
@@ -70,7 +70,7 @@ public class MultiRegTestCase implements EndpointListener {
attrs1.put("receiverAutoBind", range);
// attrs1.put("routes", host + ":" + port2 + " " + host + ":" + port3);
ReplicatedDomainRegistry reg1 = new ReplicatedDomainRegistry(extensionPoints, attrs1, "foo", "bar");
- reg1.addListener(this);
+ reg1.addEndpointListener(this);
reg1.start();
Map<String, String> attrs2 = new HashMap<String, String>();
@@ -80,7 +80,7 @@ public class MultiRegTestCase implements EndpointListener {
attrs2.put("receiverAutoBind", range);
// attrs2.put("routes", host + ":"+port1);
ReplicatedDomainRegistry reg2 = new ReplicatedDomainRegistry(extensionPoints, attrs2, "foo", "bar");
- reg2.addListener(this);
+ reg2.addEndpointListener(this);
reg2.start();
Map<String, String> attrs3 = new HashMap<String, String>();
@@ -90,7 +90,7 @@ public class MultiRegTestCase implements EndpointListener {
attrs3.put("receiverAutoBind", range);
// attrs3.put("routes", host + ":"+port1);
ReplicatedDomainRegistry reg3 = new ReplicatedDomainRegistry(extensionPoints, attrs3, "foo", "bar");
- reg3.addListener(this);
+ reg3.addEndpointListener(this);
reg3.start();
ep1.bind(extensionPoints, reg1);
diff --git a/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java b/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
index 010dc0fa0a..75b78be54b 100644
--- a/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
+++ b/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
@@ -35,8 +35,6 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
-import javax.xml.namespace.QName;
-
import org.apache.tuscany.sca.Node;
import org.apache.tuscany.sca.TuscanyRuntime;
import org.apache.tuscany.sca.assembly.Binding;
@@ -450,9 +448,9 @@ public class Shell {
out.println("Standalone Nodes:");
for (String nodeName : standaloneNodes.keySet()) {
Node node = standaloneNodes.get(nodeName);
- Map<String, List<QName>> scs = node.getStartedComposites();
+ Map<String, List<String>> scs = node.getStartedCompositeURIs();
for (String curi : scs.keySet()) {
- for (QName dc : scs.get(curi)) {
+ for (String dc : scs.get(curi)) {
out.println(" " + nodeName + " " + dc);
}
}
@@ -471,14 +469,12 @@ public class Shell {
}
for (String curi : ics) {
- List<QName> cs = node.getStartedComposites().get(curi);
+ List<String> cs = node.getStartedCompositeURIs().get(curi);
if (cs != null) {
- for (QName compositeQN : cs) {
+ for (String compositeURI : cs) {
out.println(" " + curi
+ " "
- + "XXX"
- + " "
- + compositeQN);
+ + compositeURI);
}
}
}