Example usage for org.springframework.boot SpringApplication setSources

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

Introduction

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

Prototype

public void setSources(Set<String> sources) 

Source Link

Document

Set additional sources that will be used to create an ApplicationContext.

Usage

From source file:org.osiam.Osiam.java

public static void main(String[] args) {
    SpringApplication application = new SpringApplication();
    String command = extractCommand(args);
    OsiamHome osiamHome = new OsiamHome();
    if ("initHome".equals(command)) {
        application.setSources(Collections.<Object>singleton(InitHome.class));
        application.setWebEnvironment(false);
    } else if ("migrateDb".equals(command)) {
        application.setSources(Collections.<Object>singleton(MigrateDb.class));
        application.setWebEnvironment(false);
        osiamHome.shouldInitializeHome(false);
    } else {//from www . j ava2 s. co  m
        application.setSources(Collections.<Object>singleton(Osiam.class));
    }
    application.addListeners(osiamHome);
    application.setDefaultProperties(DEFAULT_PROPERTIES);
    application.run(args);
}