if (key.equals(this.RPC_HANDLER_NAME) && drm.isMasterReplica(this.RPC_HANDLER_NAME))
{
this.log.debug("The list of replicants for the JG bridge has changed, computing and updating local info...");
DistributedState ds = this.partition.getDistributedStateService();
// we remove any entry from the DS whose node is dead
//
java.util.Collection coll = ds.getAllKeys(this.RPC_HANDLER_NAME);
if (coll == null)
{
this.log.debug("... No bridge info was associated with this node");
return;
}
// to avoid ConcurrentModificationException, we copy the list of keys in a new structure
//
ArrayList collCopy = new java.util.ArrayList(coll);
java.util.List newReplicantsNodeNames = drm.lookupReplicantsNodeNames(this.RPC_HANDLER_NAME);
for (int i = 0; i < collCopy.size(); i++)
{
String nodeEntry = (String) collCopy.get(i);
if (!newReplicantsNodeNames.contains(nodeEntry))
{
// the list of bridged topic contains a dead member: we remove it
//
try
{
this.log.debug("removing bridge information associated with this node from the DS");
ds.remove(this.RPC_HANDLER_NAME, nodeEntry, true);
}
catch (Exception e)
{
this.log.info("Unable to remove a node entry from the distributed cache", e);
}