nodeID, topologyMember.getBackupGroupName(),
connectorPair, last));
}
else
{
channel0.send(new ClusterTopologyChangeMessage(nodeID, connectorPair, last));
}
}
});
}
catch (RejectedExecutionException ignored)
{
// this could happen during a shutdown and we don't care, if we lost a nodeDown during a shutdown
// what can we do anyways?
}
}
public void nodeDown(final long uniqueEventID, final String nodeID)
{
// Using an executor as most of the notifications on the Topology
// may come from a channel itself
// What could cause deadlocks
try
{
entry.connectionExecutor.execute(new Runnable()
{
public void run()
{
if (channel0.supports(PacketImpl.CLUSTER_TOPOLOGY_V2))
{
channel0.send(new ClusterTopologyChangeMessage_V2(uniqueEventID, nodeID));
}
else
{
channel0.send(new ClusterTopologyChangeMessage(nodeID));
}
}
});
}
catch (RejectedExecutionException ignored)
{
// this could happen during a shutdown and we don't care, if we lost a nodeDown during a shutdown
// what can we do anyways?
}
}
@Override
public String toString()
{
return "Remote Proxy on channel " + Integer.toHexString(System.identityHashCode(this));
}
};
if (acceptorUsed.getClusterConnection() != null)
{
acceptorUsed.getClusterConnection().addClusterTopologyListener(listener);
rc.addCloseListener(new CloseListener()
{
public void connectionClosed()
{
acceptorUsed.getClusterConnection().removeClusterTopologyListener(listener);
}
});
}
else
{
// if not clustered, we send a single notification to the client containing the node-id where the server is connected to
// This is done this way so Recovery discovery could also use the node-id for non-clustered setups
entry.connectionExecutor.execute(new Runnable()
{
public void run()
{
String nodeId = server.getNodeID().toString();
Pair<TransportConfiguration, TransportConfiguration> emptyConfig = new Pair<TransportConfiguration, TransportConfiguration>(null, null);
if (channel0.supports(PacketImpl.CLUSTER_TOPOLOGY_V2))
{
channel0.send(new ClusterTopologyChangeMessage_V2(System.currentTimeMillis(), nodeId, server.getConfiguration().getName(), emptyConfig, true));
}
else
{
channel0.send(new ClusterTopologyChangeMessage(nodeId, emptyConfig, true));
}
}
});
}