I've set up something internally where I expose some of the LeadershipSelector methods via jmx so that I can easily tell a node to relinquish leadership or check the hasLeadership attribute to verify that has the leadership status.
I don't think it would be very hard to create a patch for the LeadershipSelector (and LeadershipLatch) to expose those things as mbeans directly. Has anyone considered doing this before? Exposing the ability to see values for current leader / state and to perform an "interrupt leadership" or "requeue" or "shutdown" the LeadershipSelector are very convenient. I can write up and submit a patch (with tests etc) implementing this if there is any interest. Ryan
