tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r1103531 - /tuscany/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java
Date Sun, 15 May 2011 20:14:36 GMT
Author: antelder
Date: Sun May 15 20:14:35 2011
New Revision: 1103531

URL: http://svn.apache.org/viewvc?rev=1103531&view=rev
Log:
Update to support the new registry ContributionListener function

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

Modified: tuscany/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java?rev=1103531&r1=1103530&r2=1103531&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java
Sun May 15 20:14:35 2011
@@ -30,7 +30,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -47,7 +46,6 @@ import org.apache.tuscany.sca.assembly.A
 import org.apache.tuscany.sca.assembly.Composite;
 import org.apache.tuscany.sca.assembly.Endpoint;
 import org.apache.tuscany.sca.common.xml.stax.StAXHelper;
-import org.apache.tuscany.sca.contribution.Export;
 import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
 import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
 import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
@@ -63,6 +61,7 @@ import org.apache.tuscany.sca.interfaced
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
 import org.apache.tuscany.sca.runtime.BaseEndpointRegistry;
+import org.apache.tuscany.sca.runtime.ContributionListener;
 import org.apache.tuscany.sca.runtime.EndpointRegistry;
 import org.apache.tuscany.sca.runtime.InstalledContribution;
 import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
@@ -147,6 +146,22 @@ public class HazelcastEndpointRegistry e
             runningCompositeOwners = hazelcastInstance.getMap(domainURI + "/RunningCompositeOwners");
 
             installedContributions = hazelcastInstance.getMap(domainURI + "/InstalledContributions");
+            ((IMap<String, InstalledContribution>)installedContributions).addEntryListener(new
EntryListener<String, InstalledContribution>() {
+                public void entryAdded(EntryEvent<String, InstalledContribution> event)
{
+                }
+                public void entryRemoved(EntryEvent<String, InstalledContribution>
event) {
+                    for (ContributionListener listener : contributionlisteners) {
+                        listener.contributionRemoved(event.getKey());
+                    }
+                }
+                public void entryUpdated(EntryEvent<String, InstalledContribution>
event) {
+                    for (ContributionListener listener : contributionlisteners) {
+                        listener.contributionUpdated(event.getKey());
+                    }
+                }
+                public void entryEvicted(EntryEvent<String, InstalledContribution>
event) {
+                }
+            }, false);
             
             hazelcastInstance.getCluster().addMembershipListener(this);
 //        }
@@ -619,4 +634,9 @@ public class HazelcastEndpointRegistry e
         installedContributions.put(ic.getURI(), ic);
     }
 
+    @Override
+    public void updateInstalledContribution(InstalledContribution ic) {
+        installedContributions.put(ic.getURI(), ic);
+    }
+
 }



Mime
View raw message