Example usage for org.springframework.boot.autoconfigure.jdbc DataSourceSchemaCreatedEvent DataSourceSchemaCreatedEvent

List of usage examples for org.springframework.boot.autoconfigure.jdbc DataSourceSchemaCreatedEvent DataSourceSchemaCreatedEvent

Introduction

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

Prototype

public DataSourceSchemaCreatedEvent(DataSource source) 

Source Link

Document

Create a new DataSourceSchemaCreatedEvent .

Usage

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

private void initialize(DataSourceInitializer initializer) {
    try {/* w  ww .  ja  va2s .  com*/
        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() + ")");
    }
}