diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-10 14:10:55 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-10 14:10:55 +0000 |
commit | 89139c0cf8474dd0b785fb312674bc6a9ed94c81 (patch) | |
tree | a71dd3588392a1e817c419903bda2e53f35c64ac /sca-java-2.x/trunk/modules/domain-hazelcast/src/main | |
parent | 666d26cb2302724c0c4feeb656a0113de05cd2d1 (diff) |
Start adding info about installed contributions to the registry so that distributed Nodes can find out about contributions
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1101468 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-hazelcast/src/main')
-rw-r--r-- | sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java b/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java index 8125a2c886..a0144b0a63 100644 --- a/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java +++ b/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java @@ -99,7 +99,9 @@ public class HazelcastEndpointRegistry extends BaseEndpointRegistry implements E protected Map<Object, Object> endpointWsdls; protected Map<String, Endpoint> localEndpoints = new ConcurrentHashMap<String, Endpoint>(); - + + protected Map<String, String> installedContributions; + protected AssemblyFactory assemblyFactory; protected Object shutdownMutex = new Object(); protected Properties properties; @@ -141,6 +143,8 @@ public class HazelcastEndpointRegistry extends BaseEndpointRegistry implements E runningComposites = hazelcastInstance.getMap(domainURI + "/CompositeOwners"); runningCompositeOwners = hazelcastInstance.getMultiMap(domainURI + "/CompositeOwners"); + installedContributions = hazelcastInstance.getMap(domainURI + "/InstalledContributions"); + hazelcastInstance.getCluster().addMembershipListener(this); // } } @@ -485,7 +489,6 @@ public class HazelcastEndpointRegistry extends BaseEndpointRegistry implements E return null; } - @Override public void addRunningComposite(Composite composite) { String localMemberAddr = hazelcastInstance.getCluster().getLocalMember().getInetSocketAddress().toString(); String compositeXML = writeComposite(composite); @@ -501,7 +504,6 @@ public class HazelcastEndpointRegistry extends BaseEndpointRegistry implements E } } - @Override public void removeRunningComposite(QName name) { String localMemberAddr = hazelcastInstance.getCluster().getLocalMember().getInetSocketAddress().toString(); Transaction txn = hazelcastInstance.getTransaction(); @@ -516,13 +518,11 @@ public class HazelcastEndpointRegistry extends BaseEndpointRegistry implements E } } - @Override public Composite getRunningComposite(QName name) { String compositeXML = runningComposites.get(name); return readComposite(compositeXML); } - @Override public List<QName> getRunningCompositeNames() { return new ArrayList<QName>(runningCompositeOwners.values()); } @@ -557,4 +557,20 @@ public class HazelcastEndpointRegistry extends BaseEndpointRegistry implements E throw new RuntimeException(e); } } + + public void installContribution(String uri, String url) { + installedContributions.put(uri, url); + } + + public List<String> getInstalledContributionURIs() { + return new ArrayList<String>(installedContributions.keySet()); + } + + public String getInstalledContributionURL(String uri) { + return installedContributions.get(uri); + } + + public void uninstallContribution(String uri) { + installedContributions.remove(uri); + } } |