public static void setClusteringEnabled(boolean enabled) {
        if (enabled) {
            // Check that clustering is not already enabled and we are already in a cluster
            if (isClusteringEnabled() && isClusteringStarted()) {
                return;
            }
        }
        else {
            // Check that clustering is disabled
            if (!isClusteringEnabled()) {
                return;
            }
        }
        // set the clustering property (listener will start/stop as needed)
        JiveGlobals.setXMLProperty(CLUSTER_PROPERTY_NAME, Boolean.toString(enabled));
    }
Sets true if clustering support is enabled. An attempt to start or join
an existing cluster will be attempted in the service was enabled. On the
other hand, if disabled then this JVM will leave or stop the cluster.

@param enabled if clustering support is enabled.
xmppserver/src/main/java/org/jivesoftware/openfire/cluster/ClusterManager.java