* @param cluster
* @return the elected Node
* @throws JMSException
*/
public Node doElection(Cluster cluster) throws JMSException {
Node elect = cluster.getLocalNode();
Map nodes = cluster.getNodes();
for (Iterator i = nodes.values().iterator(); i.hasNext();) {
Node node = (Node) i.next();
if (elect.getName().compareTo(node.getName()) < 0) {
elect = node;
}
}
return elect;