com.holonplatform.jdbc

## Interface DataSourceFactory

- All Superinterfaces:
    Serializable

      public interface DataSourceFactory
      extends Serializable

  Factory interface to create a `DataSource` instance according to the declared `getDataSourceType()` type name and using a `DataSourceConfigProperties` property set.

  The DataSource type name corresponds to the one specified through the property `DataSourceConfigProperties.TYPE`.

  The `DataSourceFactory` implementations are used by `DataSourceBuilder` to create `DataSource` instances and can be registered using default Java `ServiceLoader` extension, through a `com.holonplatform.jdbc.DataSourceFactory` file under the `META-INF/services` folder.

  The `Priority` annotation on `DataSourceFactory` class (where less priority value means higher priority order) can be used to order the factories.

  Since:
    5.0.0
  See Also:
    `DataSourceBuilder`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `DataSource` | `build(DataSourceConfigProperties configurationProperties)` Build a DataSource instance using given configuration properties.
    `String` | `getDataSourceType()` Get the symbolic DataSource type name to which this factory is bound

- - ### Method Detail

    - #### getDataSourceType

          String getDataSourceType()

      Get the symbolic DataSource type name to which this factory is bound
      Returns:
        DataSource type name

    - #### build

          DataSource build(DataSourceConfigProperties configurationProperties)
                    throws com.holonplatform.core.config.ConfigPropertySet.ConfigurationException

      Build a DataSource instance using given configuration properties.
      Parameters:
        `configurationProperties` - Configuration properties
      Returns:
        DataSource instance configured according to given configuration properties
      Throws:
        `com.holonplatform.core.config.ConfigPropertySet.ConfigurationException` - If an error occurred

Copyright © 2019 The Holon Platform. All rights reserved.