org.appng.core.repository.config

## Interface DatasourceConfigurer

- All Known Implementing Classes:
    DataSourceFactory, HikariCPConfigurer, TomcatJdbcConfigurer

      public interface DatasourceConfigurer

  A `DatasourceConfigurer` is responsible for configuring and providing a `DataSource` based upon a `DatabaseConnection`. For performance reasons, some kind of connection-pooling should be applied.
  Author:
    Matthias Müller

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `DEFAULT_LIFE_TIME`
    `static long` | `DEFAULT_TIMEOUT`
    `static String` | `JMX_DOMAIN` the JMX-domain to register the configurer instance at

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `configure(DatabaseConnection connection)` Configures the instance using the settings of the given `DatabaseConnection`.
    `void` | `destroy()` Destroys the instance.
    `DataSource` | `getDataSource()` Returns a `DataSource`
    `default void` | `setAutoCommit(boolean autoCommit)` Set autoCommit mode for the `Connection`s returned by the `DataSource`
    `void` | `setConnectionTimeout(long connectionTimeout)` Sets the connection timeout in milliseconds
    `void` | `setLogPerformance(boolean logPerformance)` Whether or not JDBC performance logger should be used
    `void` | `setMaxLifetime(long maxLifetime)` Sets the maximum lifetime for a connection in the pool
    `void` | `setValidationTimeout(long validationTimeout)` Sets the validation timeout in milliseconds

- - ### Field Detail

    - #### DEFAULT_TIMEOUT

          static final long DEFAULT_TIMEOUT

    - #### DEFAULT_LIFE_TIME

          static final long DEFAULT_LIFE_TIME

    - #### JMX_DOMAIN

          static final String JMX_DOMAIN

      the JMX-domain to register the configurer instance at
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### configure

          void configure(DatabaseConnection connection)

      Configures the instance using the settings of the given `DatabaseConnection`.
      Parameters:
        `connection` - a `DatabaseConnection`

    - #### destroy

          void destroy()

      Destroys the instance.

    - #### getDataSource

          DataSource getDataSource()

      Returns a `DataSource`
      Returns:
        the `DataSource`

    - #### setLogPerformance

          void setLogPerformance(boolean logPerformance)

      Whether or not JDBC performance logger should be used

    - #### setConnectionTimeout

          void setConnectionTimeout(long connectionTimeout)

      Sets the connection timeout in milliseconds
      Parameters:
        `connectionTimeout` - the timeout

    - #### setValidationTimeout

          void setValidationTimeout(long validationTimeout)

      Sets the validation timeout in milliseconds
      Parameters:
        `validationTimeout` - the timeout

    - #### setMaxLifetime

          void setMaxLifetime(long maxLifetime)

      Sets the maximum lifetime for a connection in the pool
      Parameters:
        `maxLifetime` - the maximum lifetime

    - #### setAutoCommit

          default void setAutoCommit(boolean autoCommit)

      Set autoCommit mode for the `Connection`s returned by the `DataSource`
      Parameters:
        `autoCommit` - enables/disables autoCommit

Copyright © 2011–2023 aiticon GmbH. All rights reserved.