@SuppressWarnings({"unused", "WeakerAccess"})
    public static boolean isSeniorClusterMemberOrNotClustered() {
        try {
            ClusterManager.waitForClusteringToStart();
            return ClusterManager.isSeniorClusterMember();
        } catch (final InterruptedException ignored) {
            // We were interrupted before clustering started. Re-interrupt the thread, and return false.
            Thread.currentThread().interrupt();
            return false;
        }
    }
Returns true if this member is the senior member in the cluster. If clustering
is not enabled, this method will also return true. This test is useful for
tasks that should only be run on a single member in a cluster. Unlike {@link #isSeniorClusterMember()} this method
will block, if necessary, until clustering has completed initialisation. For that reason, do not call in a
plugin creation or initialisation stage.

@return true if this cluster member is the senior or if clustering is not enabled.
@see #isSeniorClusterMember()
@since Openfire 4.3.0
xmppserver/src/main/java/org/jivesoftware/openfire/cluster/ClusterManager.java