tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r1124147 - /tuscany/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java
Date Wed, 18 May 2011 09:42:02 GMT
Author: antelder
Date: Wed May 18 09:42:01 2011
New Revision: 1124147

URL: http://svn.apache.org/viewvc?rev=1124147&view=rev
Log:
Use transaction again as it works with Strings instead of QNames

Modified:
    tuscany/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java

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=1124147&r1=1124146&r2=1124147&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:42:01 2011
@@ -514,27 +514,26 @@ public class HazelcastDomainRegistry ext
     public void addRunningComposite(String curi, Composite composite) {
         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<String, String> cs = runningComposites.get(curi);
-        if (cs == null) {
-            cs = new HashMap<String, String>();
-        }
-        cs.put(composite.getURI(), compositeXML);
-        runningComposites.put(curi, cs);
-        Map<String, List<String>> ocs = runningCompositeOwners.get(localMemberAddr);
-        if (ocs == null) {
-            ocs = new HashMap<String, List<String>>();
-        }
-        List<String> lcs = ocs.get(curi);
-        if (lcs == null) {
-            lcs = new ArrayList<String>();
-            ocs.put(curi, lcs);
-        }
-        lcs.add(composite.getURI());
-        runningCompositeOwners.put(localMemberAddr, ocs);
+            Map<String, String> cs = runningComposites.get(curi);
+            if (cs == null) {
+                cs = new HashMap<String, String>();
+            }
+            cs.put(composite.getURI(), compositeXML);
+            runningComposites.put(curi, cs);
+            Map<String, List<String>> ocs = runningCompositeOwners.get(localMemberAddr);
+            if (ocs == null) {
+                ocs = new HashMap<String, List<String>>();
+            }
+            List<String> lcs = ocs.get(curi);
+            if (lcs == null) {
+                lcs = new ArrayList<String>();
+                ocs.put(curi, lcs);
+            }
+            lcs.add(composite.getURI());
+            runningCompositeOwners.put(localMemberAddr, ocs);
             txn.commit();
         } catch (Throwable e) {
             txn.rollback();



Mime
View raw message