diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-21 09:42:41 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-21 09:42:41 +0000 |
commit | 238ecf66b372844363a8dfc78ea08f3799775214 (patch) | |
tree | 59e38043afa79a457ddc4bc23be7c0d6300a495f /sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast | |
parent | 07cfae8bfa80e6b266276b0da91ee1ae67c5b7ec (diff) |
Update Hazelcast registry to check for duplicate endpoints
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@925745 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java b/sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java index a170376e07..dae2c85608 100644 --- a/sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java +++ b/sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java @@ -155,6 +155,11 @@ public class HazelcastEndpointRegistry extends BaseEndpointRegistry implements E }
public void addEndpoint(Endpoint endpoint) {
+ if (findEndpoint(endpoint.getURI()).size() > 0) {
+ Member m = getOwningMember(endpoint.getURI());
+ throw new IllegalStateException("Endpoint " + endpoint.getURI() + " already exists in domain " + configURI.getDomainName() + " at " + m.getInetSocketAddress());
+ }
+
String localMemberAddr = hazelcastInstance.getCluster().getLocalMember().getInetSocketAddress().toString();
String endpointURI = endpoint.getURI();
Transaction txn = hazelcastInstance.getTransaction();
|