@Override
    public void leftCluster()
    {
        // The local cluster node left the cluster.
        if (XMPPServer.getInstance().isShuttingDown()) {
            // Do not put effort in restoring the correct state if we're shutting down anyway.
            return;
        }

        // Upon leaving a cluster, clustered caches are reset to their local equivalent (by the swap from the clustered
        // cache implementation to the default cache implementation that's done in the implementation of
        // org.jivesoftware.util.cache.CacheFactory.leftCluster). This means that they now hold no data (as a new cache
        // has been created). Data that's available on the local node needs to be added again.
        restoreCacheContent();

        // Determine what components that we are broadcasting were available only on other
        // cluster nodes than the local one. For these, unavailability events need
        // to be sent out (eventing will be limited to the local node, as we're no longer
        // part of a cluster).
        final Iterator<Map.Entry<String, IQ>> iterator = componentInfo.entrySet().iterator();
        while (iterator.hasNext()) {
            // TODO: Iterating over the 'componentInfo' is not ideal, as there might be components for which there is no recorded data in 'componentInfo'. There currently is no other way to determine what components were active on the cluster though.
            final Map.Entry<String, IQ> entry = iterator.next();
            final JID domain = new JID(entry.getKey());
            if ( !componentCache.containsKey( domain ) ) {
                Log.debug( "The local cluster node left the cluster. The component '{}' was living on one (or more) other cluster nodes, and is no longer available. Invoking the 'component unregistered' event.", domain );
                notifyComponentUnregistered( domain );

                // Also clean up the cache of cluster-wide service discovery results.
                iterator.remove();
            }
        }
    }
Processes packets that were sent to this service. Currently only packets that were sent from
registered components are being processed. In the future, we may also process packet of
trusted clients. Trusted clients may be able to execute ad-hoc commands such as adding or
removing components.

@param packet the packet to process.
xmppserver/src/main/java/org/jivesoftware/openfire/component/InternalComponentManager.java