org.appng.core.repository.config

## Class DataSourceFactory

- java.lang.Object
- - org.appng.core.repository.config.DataSourceFactory

- All Implemented Interfaces:
    DatasourceConfigurer, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<DataSource>

      public class DataSourceFactory
      extends Object
      implements org.springframework.beans.factory.FactoryBean<DataSource>, org.springframework.beans.factory.DisposableBean, DatasourceConfigurer

  A `FactoryBean` for `DataSource`s, using a `DatasourceConfigurer`.
  Author:
    Matthias Müller

- - ### Field Summary

    - ### Fields inherited from interface org.appng.core.repository.config.DatasourceConfigurer

      `DEFAULT_LIFE_TIME, DEFAULT_TIMEOUT, JMX_DOMAIN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataSourceFactory()`
    `DataSourceFactory(DatasourceConfigurer configurer)`

  - ### Method Summary

    All Methods Instance Methods Concrete 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`
    `DataSource` | `getObject()`
    `Class<?>` | `getObjectType()`
    `boolean` | `isSingleton()`

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

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

    - ### Methods inherited from interface org.appng.core.repository.config.DatasourceConfigurer

      `setAutoCommit, setConnectionTimeout, setLogPerformance, setMaxLifetime, setValidationTimeout`

- - ### Constructor Detail

    - #### DataSourceFactory

          public DataSourceFactory()

    - #### DataSourceFactory

          public DataSourceFactory(DatasourceConfigurer configurer)

  - ### Method Detail

    - #### getObjectType

          public Class<?> getObjectType()

      Specified by:
        `getObjectType` in interface `org.springframework.beans.factory.FactoryBean<DataSource>`

    - #### isSingleton

          public boolean isSingleton()

      Specified by:
        `isSingleton` in interface `org.springframework.beans.factory.FactoryBean<DataSource>`

    - #### getObject

          public DataSource getObject()
                               throws Exception

      Specified by:
        `getObject` in interface `org.springframework.beans.factory.FactoryBean<DataSource>`
      Throws:
        `Exception`

    - #### configure

          public void configure(DatabaseConnection connection)

      Description copied from interface: `DatasourceConfigurer`
      Configures the instance using the settings of the given `DatabaseConnection`.
      Specified by:
        `configure` in interface `DatasourceConfigurer`
      Parameters:
        `connection` - a `DatabaseConnection`

    - #### destroy

          public void destroy()

      Description copied from interface: `DatasourceConfigurer`
      Destroys the instance.
      Specified by:
        `destroy` in interface `DatasourceConfigurer`
      Specified by:
        `destroy` in interface `org.springframework.beans.factory.DisposableBean`

    - #### getDataSource

          public DataSource getDataSource()

      Description copied from interface: `DatasourceConfigurer`
      Returns a `DataSource`
      Specified by:
        `getDataSource` in interface `DatasourceConfigurer`
      Returns:
        the `DataSource`

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