public void memberRemoved(MembershipEvent event) {
try {
String memberAddr = event.getMember().getInetSocketAddress().toString();
if (endpointOwners.containsKey(memberAddr)) {
synchronized (shutdownMutex) {
ILock lock = hazelcastInstance.getLock("EndpointOwners/" + memberAddr);
lock.lock();
try {
if (endpointOwners.containsKey(memberAddr)) {
Collection<String> keys = endpointOwners.remove(memberAddr);
for (Object k : keys) {
Endpoint endpoint = (Endpoint)endpointMap.remove(k);
runningComponentContributions.remove(endpoint.getComponent().getName());
}
}
if (runningCompositeOwners.containsKey(memberAddr)) {
Map<String, List<String>> cs = runningCompositeOwners.remove(memberAddr);
for (String curi : cs.keySet()) {
Map<String, String> rcs = runningComposites.get(curi);
for (String uri : cs.get(curi)) {
rcs.remove(uri);
}
}
}
} finally {
lock.unlock();
}
}
}
} catch (Exception e) {
if (e.getCause() != null && e.getCause().getCause() != null) {