/** * Terminate all active sessions. * * @return a future representing the asynchronous session termination process. */ Future<Boolean> shutdown() { // Create a simple executor that will do the backgrounding for us ... final ExecutorService executor = Executors.newSingleThreadExecutor(new NamedThreadFactory("modeshape-repository-stop")); try { // Submit a runnable to terminate all sessions ... return executor.submit(() -> doShutdown(false)); } finally { // Now shutdown the executor and return the future ... executor.shutdown(); } }
/** * Terminate all active sessions. * * @return a future representing the asynchronous session termination process. */ Future<Boolean> shutdown() { // Create a simple executor that will do the backgrounding for us ... final ExecutorService executor = Executors.newSingleThreadExecutor(new NamedThreadFactory("modeshape-repository-stop")); try { // Submit a runnable to terminate all sessions ... return executor.submit(() -> doShutdown(false)); } finally { // Now shutdown the executor and return the future ... executor.shutdown(); } }
private void wipeRepository() { // shutdown the repo and remove all repo data (stored on disk) repository().doShutdown(false); assertTrue(FileUtil.delete(backupRepoDir)); }
public static void killRepository( JcrRepository repository ) { if (repository == null || repository.getState() != State.RUNNING) return; try { // Rollback any open transactions ... killTransaction(repository.runningState().txnManager()); // First shut down the repository ... repository.doShutdown(false); } catch (Throwable t) { log.error(t, JcrI18n.errorKillingRepository, repository.getName(), t.getMessage()); } }
protected final void completeRestore(RestoreOptions options) throws ExecutionException, Exception { if (getState() == State.RESTORING) { logger.debug("Shutting down '{0}' after content has been restored", getName()); doShutdown(false); logger.debug("Starting '{0}' after content has been restored", getName()); start(); logger.debug("Started '{0}' after content has been restored; beginning indexing of content", getName()); if (options.reindexContentOnFinish()) { // Reindex all content ... queryManager().cleanAndReindex(false); logger.debug("Completed reindexing all content in '{0}' after restore.", getName()); } } }
protected final void completeRestore(RestoreOptions options) throws ExecutionException, Exception { if (getState() == State.RESTORING) { logger.debug("Shutting down '{0}' after content has been restored", getName()); doShutdown(false); logger.debug("Starting '{0}' after content has been restored", getName()); start(); logger.debug("Started '{0}' after content has been restored; beginning indexing of content", getName()); if (options.reindexContentOnFinish()) { // Reindex all content ... queryManager().cleanAndReindex(false); logger.debug("Completed reindexing all content in '{0}' after restore.", getName()); } } }
} catch (Throwable t) { try { doShutdown(true); resumeExistingUserTransaction(); } catch (Exception e) {
} catch (Throwable t) { try { doShutdown(true); resumeExistingUserTransaction(); } catch (Exception e) {