org.springframework.boot.sql.init.dependency

Interface DatabaseInitializerDetector

  • All Superinterfaces:
    org.springframework.core.Ordered
    All Known Implementing Classes:
    AbstractBeansOfTypeDatabaseInitializerDetector


    public interface DatabaseInitializerDetector
    extends org.springframework.core.Ordered
    Detects beans that initialize an SQL database. Implementations should be registered in META-INF/spring.factories under the key org.springframework.boot.sql.init.dependency.DatabaseInitializerDetector.
    Since:
    2.5.0
    • Field Summary

      • Fields inherited from interface org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method and Description
      java.util.Set<java.lang.String> detect(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
      Detect beans defined in the given beanFactory that initialize a DataSource.
      default void detectionComplete(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory, java.util.Set<java.lang.String> dataSourceInitializerNames)
      Callback indicating that all known DataSourceInitializerDetectors have been called and detection of beans that initialize a DataSource is complete.
      default int getOrder() 
    • Method Detail

      • detect

        java.util.Set<java.lang.String> detect(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
        Detect beans defined in the given beanFactory that initialize a DataSource.
        Parameters:
        beanFactory - bean factory to examine
        Returns:
        names of the detected DataSource initializer beans, or an empty set if none were detected.
      • detectionComplete

        default void detectionComplete(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
                                       java.util.Set<java.lang.String> dataSourceInitializerNames)
        Callback indicating that all known DataSourceInitializerDetectors have been called and detection of beans that initialize a DataSource is complete.
        Parameters:
        beanFactory - bean factory that was examined
        dataSourceInitializerNames - names of the DataSource initializer beans detected by all known detectors
      • getOrder

        default int getOrder()
        Specified by:
        getOrder in interface org.springframework.core.Ordered