Example usage for org.springframework.boot SpringApplication BANNER_LOCATION_PROPERTY

List of usage examples for org.springframework.boot SpringApplication BANNER_LOCATION_PROPERTY

Introduction

In this page you can find the example usage for org.springframework.boot SpringApplication BANNER_LOCATION_PROPERTY.

Prototype

String BANNER_LOCATION_PROPERTY

To view the source code for org.springframework.boot SpringApplication BANNER_LOCATION_PROPERTY.

Click Source Link

Document

Banner location property key.

Usage

From source file:com.thinkbiganalytics.server.KyloServerApplication.java

public static void main(String[] args) {

    KyloVersion dbVersion = getDatabaseVersion();

    boolean skipUpgrade = KyloVersionUtil.isUpToDate(dbVersion);

    if (!skipUpgrade) {
        boolean upgradeComplete = false;
        do {//from  w ww. j ava  2  s  .  c  o  m
            log.info("Upgrading...");
            System.setProperty(SpringApplication.BANNER_LOCATION_PROPERTY, "upgrade-banner.txt");
            ConfigurableApplicationContext cxt = SpringApplication.run(UpgradeKyloConfig.class);
            KyloUpgrader upgrader = cxt.getBean(KyloUpgrader.class);
            upgradeComplete = upgrader.upgrade();
            cxt.close();
        } while (!upgradeComplete);
        log.info("Upgrading complete");
    } else {
        log.info("Kylo v{} is up to date.  Starting the application.", dbVersion);
    }
    System.setProperty(SpringApplication.BANNER_LOCATION_PROPERTY, "banner.txt");
    SpringApplication.run("classpath:application-context.xml", args);
}

From source file:com.thinkbiganalytics.server.upgrade.KyloUpgrader.java

public void upgrade() {
    System.setProperty(SpringApplication.BANNER_LOCATION_PROPERTY, "upgrade-banner.txt");
    ConfigurableApplicationContext upgradeCxt = new SpringApplicationBuilder(KyloUpgradeConfig.class).web(true)
            .profiles(KYLO_UPGRADE).run();
    try {/*from w w w .  j a v  a 2  s  .c om*/
        KyloUpgradeService upgradeService = upgradeCxt.getBean(KyloUpgradeService.class);
        // Keep upgrading until upgrade() returns true, i.e. we are up-to-date;
        while (!upgradeService.upgradeNext())
            ;
    } finally {
        upgradeCxt.close();
    }
}