com.holonplatform.jdbc.spring.internal

## Class DataSourceRegistrar

- java.lang.Object
- - com.holonplatform.spring.internal.AbstractConfigPropertyRegistrar
  - - com.holonplatform.jdbc.spring.internal.DataSourceRegistrar

- All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.annotation.ImportBeanDefinitionRegistrar, org.springframework.context.EnvironmentAware

      public class DataSourceRegistrar
      extends com.holonplatform.spring.internal.AbstractConfigPropertyRegistrar

  Bean registration class to register a `DataSource` using `DataSourceConfigProperties` configuration properties and `EnableDataSource` annotations.

  NOTE: This class is intended for internal framework use only.

  Since:
    5.0.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataSourceRegistrar()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `registerBeanDefinitions(org.springframework.core.type.AnnotationMetadata annotationMetadata, org.springframework.beans.factory.support.BeanDefinitionRegistry registry)`
    `static String` | `registerDataSource(org.springframework.core.env.Environment environment, org.springframework.beans.factory.support.BeanDefinitionRegistry registry, String dataContextId, com.holonplatform.spring.PrimaryMode primaryMode)` Register a `DataSource` bean
    `static String` | `registerDataSource(SpringDataSourceConfigProperties dataSourceConfigProperties, org.springframework.beans.factory.support.BeanDefinitionRegistry registry, String dataContextId, com.holonplatform.spring.PrimaryMode primaryMode)` Register a `DataSource` bean
    `static String` | `registerDataSourceTransactionManager(org.springframework.beans.factory.support.BeanDefinitionRegistry registry, String dataSourceBeanName, String dataContextId, com.holonplatform.spring.PrimaryMode primaryMode)` Register a `PlatformTransactionManager` bound to given `DataSource` bean name

    - ### Methods inherited from class com.holonplatform.spring.internal.AbstractConfigPropertyRegistrar

      `setEnvironment`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.springframework.context.annotation.ImportBeanDefinitionRegistrar

      `registerBeanDefinitions`

- - ### Constructor Detail

    - #### DataSourceRegistrar

          public DataSourceRegistrar()

  - ### Method Detail

    - #### registerBeanDefinitions

          public void registerBeanDefinitions(org.springframework.core.type.AnnotationMetadata annotationMetadata,
                                              org.springframework.beans.factory.support.BeanDefinitionRegistry registry)

    - #### registerDataSource

          public static String registerDataSource(org.springframework.core.env.Environment environment,
                                                  org.springframework.beans.factory.support.BeanDefinitionRegistry registry,
                                                  String dataContextId,
                                                  com.holonplatform.spring.PrimaryMode primaryMode)

      Register a `DataSource` bean
      Parameters:
        `environment` - Environment as configuration properties source
        `registry` - BeanDefinitionRegistry
        `dataContextId` - Data context id
        `primaryMode` - Primary mode
      Returns:
        Registered DataSource bean name

    - #### registerDataSource

          public static String registerDataSource(SpringDataSourceConfigProperties dataSourceConfigProperties,
                                                  org.springframework.beans.factory.support.BeanDefinitionRegistry registry,
                                                  String dataContextId,
                                                  com.holonplatform.spring.PrimaryMode primaryMode)

      Register a `DataSource` bean
      Parameters:
        `dataSourceConfigProperties` - DataSource configuration properties
        `registry` - BeanDefinitionRegistry
        `dataContextId` - Data context id
        `primaryMode` - Primary mode
      Returns:
        Registered DataSource bean name

    - #### registerDataSourceTransactionManager

          public static String registerDataSourceTransactionManager(org.springframework.beans.factory.support.BeanDefinitionRegistry registry,
                                                                    String dataSourceBeanName,
                                                                    String dataContextId,
                                                                    com.holonplatform.spring.PrimaryMode primaryMode)

      Register a `PlatformTransactionManager` bound to given `DataSource` bean name
      Parameters:
        `registry` - Bean definitions registry
        `dataSourceBeanName` - DataSource bean name
        `dataContextId` - Data context id
        `primaryMode` - Primary mode
      Returns:
        Registered transaction manager bean name

Copyright © 2019 The Holon Platform. All rights reserved.