use of org.jivesoftware.openfire.disco.ServerFeaturesProvider in project Openfire by igniterealtime.
the class AbstractXepSupport method start.
public void start() {
for (IQHandler iqHandler : iqHandlers) {
try {
iqHandler.initialize(server);
iqHandler.start();
} catch (Exception e) {
Log.error("Unable to initialize and start " + iqHandler.getClass());
continue;
}
element2Handlers.put(iqHandler.getInfo().getName(), iqHandler);
if (iqHandler instanceof ServerFeaturesProvider) {
for (Iterator<String> i = ((ServerFeaturesProvider) iqHandler).getFeatures(); i.hasNext(); ) {
server.getIQDiscoInfoHandler().addServerFeature(i.next());
}
}
if (muc) {
MultiUserChatManager manager = server.getMultiUserChatManager();
for (MultiUserChatService mucService : manager.getMultiUserChatServices()) {
mucService.addIQHandler(iqHandler);
mucService.addExtraFeature(namespace);
}
}
}
server.getIQDiscoInfoHandler().addServerFeature(namespace);
server.getIQRouter().addHandler(iqDispatcher);
}
use of org.jivesoftware.openfire.disco.ServerFeaturesProvider 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);
}
}
Aggregations