Example usage for org.springframework.boot.autoconfigure.jdbc DataSourceInitializer getDataSource

List of usage examples for org.springframework.boot.autoconfigure.jdbc DataSourceInitializer getDataSource

Introduction

In this page you can find the example usage for org.springframework.boot.autoconfigure.jdbc DataSourceInitializer getDataSource.

Prototype

DataSource getDataSource() 

Source Link

Usage

From source file:org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker.java

private void initialize(DataSourceInitializer initializer) {
    try {//  w w w  .  j a  va 2 s. c o  m
        this.applicationContext.publishEvent(new DataSourceSchemaCreatedEvent(initializer.getDataSource()));
        // The listener might not be registered yet, so don't rely on it.
        if (!this.initialized) {
            this.dataSourceInitializer.initSchema();
            this.initialized = true;
        }
    } catch (IllegalStateException ex) {
        logger.warn("Could not send event to complete DataSource initialization (" + ex.getMessage() + ")");
    }
}