/** * <p>Stop the service</p> */ public void stopAndWait() { log.debug("Service {} stopping...", this.getClass().getSimpleName()); context.resetToStopped(); // Ensure downstream subscribers are purged HardwareWalletEvents.unsubscribeAll(); MessageEvents.unsubscribeAll(); try { clientMonitorService.awaitTermination(1, TimeUnit.SECONDS); } catch (InterruptedException e) { log.warn("Client monitor thread did not terminate within the allowed time"); } stopped = true; }
public void stop() { log.debug("Stopping MultiBit HD"); mainController = null; // Final purge in case anything gets missed ViewEvents.unsubscribeAll(); ControllerEvents.unsubscribeAll(); CoreEvents.unsubscribeAll(); HardwareWalletEvents.unsubscribeAll(); }