@Override public void destroyPlugin() { // Degister HistoryPacketInterceptor final HistoryPacketInterceptor historyPacketInterceptor = HistoryPacketInterceptor.singleton(); final InterceptorManager interceptorManager = InterceptorManager.getInstance(); interceptorManager.removeInterceptor(historyPacketInterceptor); // Deregister PredictionIQHandler final XMPPServer xmppServer = XMPPServer.getInstance(); final IQRouter iqRouter = xmppServer.getIQRouter(); final PredictionIQHandler predictionIQHandler = PredictionIQHandler.singleton(); iqRouter.removeHandler(predictionIQHandler); // Deregister LocationRepository final LocationRepository locationRepo = LocationRepository.singleton(); iqRouter.removeHandler(locationRepo); }
@Override public void initializePlugin(final PluginManager pluginManager, final File pluginDirectory) { initialize(); // Register HistoryPacketInterceptor final HistoryPacketInterceptor historyPacketInterceptor = HistoryPacketInterceptor.singleton(); InterceptorManager.getInstance().addInterceptor(historyPacketInterceptor); // Register PredictionIQHandler final XMPPServer xmppServer = XMPPServer.getInstance(); final IQRouter iqRouter = xmppServer.getIQRouter(); final PredictionIQHandler predictionIQHandler = PredictionIQHandler.singleton(); iqRouter.addHandler(predictionIQHandler); // Register LocationRepository final LocationRepository locationRepo = LocationRepository.singleton(); iqRouter.addHandler(locationRepo); }