public static void addListener(ClusterEventListener listener, int sequence) {
        if (listener == null) {
            throw new NullPointerException();
        }
        listeners.add(Pair.of(sequence, listener));
    }
Registers a listener to receive events, defining the order in which listeners are invoked.

@param listener the listener.
@param sequence defines the order of listener invocation.
xmppserver/src/main/java/org/jivesoftware/openfire/cluster/ClusterManager.java