Search in sources :

Example 1 with DBInitConfig

use of net.nemerosa.ontrack.repository.support.DBInitConfig in project ontrack by nemerosa.

the class DBStartup method init.

/**
 * Runs all database configurations and runs each {@link StartupService} in turn.
 */
@PostConstruct
public void init() {
    logger.info("[db] DB initialisation.");
    for (DBInitConfig dbInitConfig : dbInitConfigs) {
        logger.info("[db] DB initialisation for \"{}\"", dbInitConfig.getName());
        DBInit dbInit = dbInitConfig.createConfig();
        dbInit.run();
    }
    logger.info("[startup] Running startup services");
    for (StartupService startupService : startupServices) {
        logger.info("[startup] Starting service \"{}\"", startupService.getName());
        startupService.start();
    }
}
Also used : DBInit(net.sf.dbinit.DBInit) DBInitConfig(net.nemerosa.ontrack.repository.support.DBInitConfig) StartupService(net.nemerosa.ontrack.model.support.StartupService) PostConstruct(javax.annotation.PostConstruct)

Aggregations

PostConstruct (javax.annotation.PostConstruct)1 StartupService (net.nemerosa.ontrack.model.support.StartupService)1 DBInitConfig (net.nemerosa.ontrack.repository.support.DBInitConfig)1 DBInit (net.sf.dbinit.DBInit)1