/** Clears any listener we used. */ private void clearListeners() { mucService.removeChatRoomListChangeListener(this); mucService.removeChatRoomProviderWrapperListener(this); if (protolProviderRegistrationListener != null) MUCActivator.bundleContext.removeServiceListener(protolProviderRegistrationListener); protolProviderRegistrationListener = null; for (ProtocolProviderService pps : MUCActivator.getChatRoomProviders()) { removeQueryFromProviderPresenceListeners(pps); } }
/** Adds listeners for the query */ private void initListeners() { for (ProtocolProviderService pps : MUCActivator.getChatRoomProviders()) { addQueryToProviderPresenceListeners(pps); } mucService.addChatRoomListChangeListener(this); mucService.addChatRoomProviderWrapperListener(this); protolProviderRegistrationListener = new ProtocolProviderRegListener(); MUCActivator.bundleContext.addServiceListener(protolProviderRegistrationListener); }
@Override protected void run() { Iterator<ChatRoomProviderWrapper> chatRoomProviders = mucService.getChatRoomProviders(); while (chatRoomProviders.hasNext()) { ChatRoomProviderWrapper provider = chatRoomProviders.next(); providerAdded(provider, true); } if (getStatus() != QUERY_CANCELED) setStatus(QUERY_COMPLETED); }