tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r1124566 - in /tuscany/sca-java-2.x/trunk/modules: core-spi/src/main/java/org/apache/tuscany/sca/runtime/ core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/ deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/ domain-...
Date Thu, 19 May 2011 07:13:06 GMT
Author: antelder
Date: Thu May 19 07:13:05 2011
New Revision: 1124566

URL: http://svn.apache.org/viewvc?rev=1124566&view=rev
Log:
Add a method to get the domain members

Modified:
    tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.java
    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/NodeImpl.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/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java

Modified: tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.java?rev=1124566&r1=1124565&r2=1124566&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.java
Thu May 19 07:13:05 2011
@@ -92,4 +92,6 @@ public interface DomainRegistry {
     void removeRunningComposite(String contributionURI, String compositeURI);
     Map<String, List<String>> getRunningCompositeURIs();
     Composite getRunningComposite(String contributionURI, String compositeURI);
+    
+    List<String> getMembers();
 }

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=1124566&r1=1124565&r2=1124566&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
Thu May 19 07:13:05 2011
@@ -20,6 +20,7 @@
 package org.apache.tuscany.sca.core.assembly.impl;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -226,4 +227,9 @@ public class DomainRegistryImpl extends 
             listener.contributionUpdated(ic.getURI());
         }
     }
+
+    @Override
+    public List<String> getMembers() {
+        return Arrays.asList(new String[]{"LocalOnly"});
+    }
 }

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=1124566&r1=1124565&r2=1124566&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
Thu May 19 07:13:05 2011
@@ -876,5 +876,11 @@ public class DeployerImpl implements Dep
 
         public void updateInstalledContribution(InstalledContribution ic) {
         }
+
+        @Override
+        public List<String> getMembers() {
+            // TODO Auto-generated method stub
+            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=1124566&r1=1124565&r2=1124566&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
Thu May 19 07:13:05 2011
@@ -649,4 +649,15 @@ public class HazelcastDomainRegistry ext
         installedContributions.put(ic.getURI(), ic);
     }
 
+    @Override
+    public List<String> getMembers() {
+        List<String> members = new ArrayList<String>();
+        for (Member m : hazelcastInstance.getCluster().getMembers()) {
+            if (!m.isSuperClient()) {
+                members.add(m.getInetSocketAddress().toString());
+            }
+        }
+        return members;
+    }
+
 }

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=1124566&r1=1124565&r2=1124566&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
Thu May 19 07:13:05 2011
@@ -239,6 +239,8 @@ public interface Node {
 
     void validateContribution(String string) throws ContributionReadException, ValidationException;
     
+    List<String> getMembers();
+    
     // TODO: Add methods to get:
     //   active members in domain
     //   which composites are running on which members

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=1124566&r1=1124565&r2=1124566&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
Thu May 19 07:13:05 2011
@@ -387,4 +387,9 @@ public class NodeImpl implements Node {
         
     }
 
+    @Override
+    public List<String> getMembers() {
+        return domainRegistry.getMembers();
+    }
+
 }

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=1124566&r1=1124565&r2=1124566&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
Thu May 19 07:13:05 2011
@@ -475,4 +475,10 @@ public class ReplicatedDomainRegistry ex
         
     }
 
+    @Override
+    public List<String> getMembers() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
 }

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=1124566&r1=1124565&r2=1124566&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
Thu May 19 07:13:05 2011
@@ -73,7 +73,7 @@ public class Shell {
     private Map<String, Node> nodes = new HashMap<String, Node>();
 
     public static final String[] COMMANDS = new String[] {"bye", "domain", "domains", "domainComposite",
"help", "install", "installed", "invoke",
-                                                          "load", "remove", "run", "save",
"services", "start", "started", "stop"};
+                                                          "load", "members", "remove", "run",
"save", "services", "start", "started", "stop"};
 
     public static void main(final String[] args) throws Exception {
         boolean useJline = true;
@@ -483,6 +483,13 @@ public class Shell {
         return true;
     }
 
+    boolean members() {
+        for (String member : getNode().getMembers()) {
+            out.println(member);
+        }
+        return true;
+    }
+
     boolean status() {
         return true;
     }
@@ -594,6 +601,12 @@ public class Shell {
                     return load(toks.get(1));
                 }
             };
+        if (op.equalsIgnoreCase("members"))
+            return new Callable<Boolean>() {
+                public Boolean call() throws Exception {
+                    return members();
+                }
+            };
         if (op.equalsIgnoreCase("remove"))
             return new Callable<Boolean>() {
                 public Boolean call() throws Exception {



Mime
View raw message