com.holonplatform.jdbc.internal

## Class DefaultDataSourceBuilder

- java.lang.Object
- - com.holonplatform.jdbc.internal.DefaultDataSourceBuilder

- All Implemented Interfaces:
    DataSourceBuilder

      public class DefaultDataSourceBuilder
      extends Object
      implements DataSourceBuilder

  Default `DataSourceBuilder` implementation.
  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DefaultDataSourceBuilder.DefaultBuilder` Default `Builder`.

    - ### Nested classes/interfaces inherited from interface com.holonplatform.jdbc.DataSourceBuilder

      `DataSourceBuilder.Builder`

  - ### Field Summary

    - ### Fields inherited from interface com.holonplatform.jdbc.DataSourceBuilder

      `DEFAULT_PRIORITY, TYPE_BASIC, TYPE_DBCP, TYPE_HIKARICP, TYPE_JNDI, TYPE_TOMCAT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultDataSourceBuilder(ClassLoader classLoader)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `DataSource` | `build(DataSourceConfigProperties configurationProperties)` Build a DataSource instance using given configuration properties.
    `void` | `registerFactory(DataSourceFactory factory)` Register a `DataSourceFactory` to be used to build `DataSource` instances of the type returned by the `DataSourceFactory.getDataSourceType()` method.
    `void` | `registerPostProcessor(DataSourcePostProcessor postProcessor)` Register a new `DataSourcePostProcessor` to initialiaze and/or configure the created `DataSource` instances.

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

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

    - ### Methods inherited from interface com.holonplatform.jdbc.DataSourceBuilder

      `build, build, builder, create, create`

- - ### Constructor Detail

    - #### DefaultDataSourceBuilder

          public DefaultDataSourceBuilder(ClassLoader classLoader)

      Constructor
      Parameters:
        `classLoader` - ClassLoader to use to load default factories and post processors (not null)

  - ### Method Detail

    - #### registerFactory

          public void registerFactory(DataSourceFactory factory)

      Description copied from interface: `DataSourceBuilder`
      Register a `DataSourceFactory` to be used to build `DataSource` instances of the type returned by the `DataSourceFactory.getDataSourceType()` method.

      Any previous binding with given type will be replaced by the given `DataSourceFactory`.

      Specified by:
        `registerFactory` in interface `DataSourceBuilder`
      Parameters:
        `factory` - the factory to register (not null)
      See Also:
        `DataSourceConfigProperties.TYPE`

    - #### registerPostProcessor

          public void registerPostProcessor(DataSourcePostProcessor postProcessor)

      Description copied from interface: `DataSourceBuilder`
      Register a new `DataSourcePostProcessor` to initialiaze and/or configure the created `DataSource` instances.
      Specified by:
        `registerPostProcessor` in interface `DataSourceBuilder`
      Parameters:
        `postProcessor` - Post processor to register (not null)

    - #### build

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

      Description copied from interface: `DataSourceBuilder`
      Build a DataSource instance using given configuration properties.
      Specified by:
        `build` in interface `DataSourceBuilder`
      Parameters:
        `configurationProperties` - Configuration properties
      Returns:
        DataSource instance configured according to given configuration properties
      Throws:
        `com.holonplatform.core.config.ConfigPropertySet.ConfigurationException` - Error configuring DataSource using given configuration properties

Copyright © 2019 The Holon Platform. All rights reserved.