/** * Hook to shutdown the embedded database. Subclasses may call this method * to force shutdown. * <p>After calling, {@link #getDataSource()} returns {@code null}. * <p>Does nothing if no embedded database has been initialized. */ protected void shutdownDatabase() { if (this.dataSource != null) { if (logger.isInfoEnabled()) { if (this.dataSource instanceof SimpleDriverDataSource) { logger.info(String.format("Shutting down embedded database: url='%s'", ((SimpleDriverDataSource) this.dataSource).getUrl())); } else { logger.info(String.format("Shutting down embedded database '%s'", this.databaseName)); } } if (this.databaseConfigurer != null) { this.databaseConfigurer.shutdown(this.dataSource, this.databaseName); } this.dataSource = null; } }
/** * Hook to shutdown the embedded database. Subclasses may call to force shutdown. * After calling, {@link #getDataSource()} returns null. Does nothing if no embedded database has been initialized. */ protected void shutdownDatabase() { if (this.dataSource != null) { this.databaseConfigurer.shutdown(this.dataSource, this.databaseName); this.dataSource = null; } }
/** * Hook to shutdown the embedded database. Subclasses may call this method * to force shutdown. * <p>After calling, {@link #getDataSource()} returns {@code null}. * <p>Does nothing if no embedded database has been initialized. */ protected void shutdownDatabase() { if (this.dataSource != null) { if (logger.isInfoEnabled()) { if (this.dataSource instanceof SimpleDriverDataSource) { logger.info(String.format("Shutting down embedded database: url='%s'", ((SimpleDriverDataSource) this.dataSource).getUrl())); } else { logger.info(String.format("Shutting down embedded database '%s'", this.databaseName)); } } if (this.databaseConfigurer != null) { this.databaseConfigurer.shutdown(this.dataSource, this.databaseName); } this.dataSource = null; } }