tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r1124143 - in /tuscany/sca-java-2.x/trunk/modules: core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/ deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/ domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry...
Date Wed, 18 May 2011 09:38:01 GMT
Author: antelder
Date: Wed May 18 09:38:01 2011
New Revision: 1124143

URL: http://svn.apache.org/viewvc?rev=1124143&view=rev
Log:
Updates to match the DomainRegistry changes to rename addListener/removeListener to be addEndpointListener/removeEndpointListener
as there are now multiple types of listener, and change the running composite methods to use
the composite uri instead of its QName

Modified:
    tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java
    tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
    tuscany/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java
    tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/Node.java
    tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java
    tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
    tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java
    tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java
    tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java
    tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java
    tuscany/sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedDomainRegistry.java
    tuscany/sca-java-2.x/trunk/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
    tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java

Modified: tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java?rev=1124143&r1=1124142&r2=1124143&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java
Wed May 18 09:38:01 2011
@@ -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.LifeC
 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 
     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 
     }
 
     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) {

Modified: tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java?rev=1124143&r1=1124142&r2=1124143&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
Wed May 18 09:38:01 2011
@@ -863,14 +863,14 @@ public class DeployerImpl implements Dep
         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;
         }
 

Modified: tuscany/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java?rev=1124143&r1=1124142&r2=1124143&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java
Wed May 18 09:38:01 2011
@@ -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 ext
 
     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 ext
                             }
                         }
                         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 ext
         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 ext
         }
     }
 
-    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;

Modified: tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/Node.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/Node.java?rev=1124143&r1=1124142&r2=1124143&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/Node.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/Node.java
Wed May 18 09:38:01 2011
@@ -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

Modified: tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java?rev=1124143&r1=1124142&r2=1124143&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java
Wed May 18 09:38:01 2011
@@ -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);
     }

Modified: tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java?rev=1124143&r1=1124142&r2=1124143&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
Wed May 18 09:38:01 2011
@@ -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;

Modified: tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java?rev=1124143&r1=1124142&r2=1124143&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java
Wed May 18 09:38:01 2011
@@ -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());

Modified: tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java?rev=1124143&r1=1124142&r2=1124143&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java
Wed May 18 09:38:01 2011
@@ -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));
     }
 
 }

Modified: tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java?rev=1124143&r1=1124142&r2=1124143&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java
Wed May 18 09:38:01 2011
@@ -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));
     }
 
 }

Modified: tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java?rev=1124143&r1=1124142&r2=1124143&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java
Wed May 18 09:38:01 2011
@@ -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 {

Modified: tuscany/sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedDomainRegistry.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedDomainRegistry.java?rev=1124143&r1=1124142&r2=1124143&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedDomainRegistry.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedDomainRegistry.java
Wed May 18 09:38:01 2011
@@ -452,19 +452,19 @@ public class ReplicatedDomainRegistry ex
     }
 
     @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;
     }

Modified: tuscany/sca-java-2.x/trunk/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java?rev=1124143&r1=1124142&r2=1124143&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
Wed May 18 09:38:01 2011
@@ -70,7 +70,7 @@ public class MultiRegTestCase implements
         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
         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
         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);

Modified: tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java?rev=1124143&r1=1124142&r2=1124143&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
Wed May 18 09:38:01 2011
@@ -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);
                 }
                     }
                 }



Mime
View raw message