@Deactivate public void deactivate() { CompletableFuture.allOf(inMemoryDatabase.close(), partitionedDatabase.close()) .thenCompose(v -> coordinator.close()) .whenComplete( (result, error) -> { if (error != null) { log.warn("Failed to cleanly close databases.", error); } else { log.info("Successfully closed databases."); } }); clusterCommunicator.removeSubscriber(QUEUE_UPDATED_TOPIC); maps.values().forEach(this::unregisterMap); if (applicationService != null) { applicationService.removeListener(appListener); } eventDispatcher.shutdown(); queuePollExecutor.shutdown(); log.info("Stopped"); }
protected void unbindApplicationService(ApplicationService service) { applicationService.removeListener(appListener); this.applicationService = null; }
protected void bindApplicationService(ApplicationService service) { applicationService = service; applicationService.addListener(appListener); }