Search in sources :

Example 1 with IQDiscoInfoHandler

use of org.jivesoftware.openfire.disco.IQDiscoInfoHandler in project Openfire by igniterealtime.

the class AbstractXepSupport method stop.

public void stop() {
    IQRouter iqRouter = server.getIQRouter();
    IQDiscoInfoHandler iqDiscoInfoHandler = server.getIQDiscoInfoHandler();
    for (IQHandler iqHandler : iqHandlers) {
        element2Handlers.remove(iqHandler.getInfo().getName());
        try {
            iqHandler.stop();
            iqHandler.destroy();
        } catch (Exception e) {
            Log.warn("Unable to stop and destroy " + iqHandler.getClass());
        }
        if (iqHandler instanceof ServerFeaturesProvider) {
            for (Iterator<String> i = ((ServerFeaturesProvider) iqHandler).getFeatures(); i.hasNext(); ) {
                if (iqDiscoInfoHandler != null) {
                    iqDiscoInfoHandler.removeServerFeature(i.next());
                }
            }
        }
        if (muc) {
            MultiUserChatManager manager = server.getMultiUserChatManager();
            for (MultiUserChatService mucService : manager.getMultiUserChatServices()) {
                mucService.removeIQHandler(iqHandler);
                mucService.removeExtraFeature(namespace);
            }
        }
    }
    if (iqRouter != null) {
        iqRouter.removeHandler(iqDispatcher);
    }
}
Also used : IQDiscoInfoHandler(org.jivesoftware.openfire.disco.IQDiscoInfoHandler) IQHandler(org.jivesoftware.openfire.handler.IQHandler) MultiUserChatManager(org.jivesoftware.openfire.muc.MultiUserChatManager) MultiUserChatService(org.jivesoftware.openfire.muc.MultiUserChatService) ServerFeaturesProvider(org.jivesoftware.openfire.disco.ServerFeaturesProvider) IQRouter(org.jivesoftware.openfire.IQRouter) UnauthorizedException(org.jivesoftware.openfire.auth.UnauthorizedException)

Aggregations

IQRouter (org.jivesoftware.openfire.IQRouter)1 UnauthorizedException (org.jivesoftware.openfire.auth.UnauthorizedException)1 IQDiscoInfoHandler (org.jivesoftware.openfire.disco.IQDiscoInfoHandler)1 ServerFeaturesProvider (org.jivesoftware.openfire.disco.ServerFeaturesProvider)1 IQHandler (org.jivesoftware.openfire.handler.IQHandler)1 MultiUserChatManager (org.jivesoftware.openfire.muc.MultiUserChatManager)1 MultiUserChatService (org.jivesoftware.openfire.muc.MultiUserChatService)1