/** * Quits the Rendezvous daemon and saves all preferences * * @param notification Notification name */ @Override public void applicationWillTerminate(NSNotification notification) { if(log.isDebugEnabled()) { log.debug(String.format("Application will quit with notification %s", notification)); } this.invalidate(); // Clear temporary files TemporaryFileServiceFactory.get().shutdown(); //Terminating rendezvous discovery RendezvousFactory.instance().quit(); // Remove notifications from center NotificationServiceFactory.get().unregister(); // Disable update updater.unregister(); //Writing usage info preferences.setProperty("uses", preferences.getInteger("uses") + 1); preferences.save(); DefaultBackgroundExecutor.get().shutdown(); }