private void process(IQ iq) {
        // Ignore IQs of type ERROR
        if (IQ.Type.error == iq.getType()) {
            return;
        }
        Element childElement = iq.getChildElement();
        String namespace = null;

        if (childElement != null) {
            namespace = childElement.getNamespaceURI();
        }
        if ("http://jabber.org/protocol/disco#info".equals(namespace)) {
            if (iqDiscoInfoHandler != null) {
                IQ reply = iqDiscoInfoHandler.handleIQ(iq);
                router.route(reply);
            } else {
                Log.trace("Responding with 'service-unavailable' due to unavailable Disco Info Handler to: {}", iq);
                sendServiceUnavailablePacket(iq);
                return;
            }
        }
        else if ("http://jabber.org/protocol/disco#items".equals(namespace)) {
            if (iqDiscoItemsHandler != null) {
                IQ reply = iqDiscoItemsHandler.handleIQ(iq);
                router.route(reply);
            } else {
                Log.trace("Responding with 'service-unavailable' due to unavailable Disco Items Handler to: {}", iq);
                sendServiceUnavailablePacket(iq);
                return;
            }
            
        }
        else {
            // Unknown namespace requested so return error to sender
            Log.trace("Responding with 'service-unavailable' due to unknown namespace in request to: {}", iq);
            sendServiceUnavailablePacket(iq);
        }
    }
Manager of entities that interact with persistent storage of data (eg: the database).
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/PubSubModule.java