Package org.apache.torque.dsfactory

# Schnittstelle DataSourceFactory

Alle bekannten Implementierungsklassen:
  `AbstractDataSourceFactory`, `JndiDataSourceFactory`, `PerUserPool2DataSourceFactory`, `SharedPool2DataSourceFactory`

public interface DataSourceFactory
A factory that returns a DataSource.

Version:
  $Id: DataSourceFactory.java 1867515 2019-09-25 15:02:03Z gk $
Autor:
  John McNally, Thomas Fischer

- ## Feldübersicht

  Felder
  Modifizierer und Typ
  Feld
  Beschreibung
  `static final String`
  `DSFACTORY_KEY`
  Key for the configuration which contains DataSourceFactories
  `static final String`
  `FACTORY_KEY`
  Key for the configuration which contains the fully qualified name of the factory implementation class

- ## Methodenübersicht

  Modifizierer und Typ
  Methode
  Beschreibung
  `void`
  `close()`
  A hook which is called when the resources of the associated DataSource can be released.
  `DataSource`
  `getDataSource()`
  `void`
  `initialize(org.apache.commons.configuration2.Configuration configuration)`
  Initialize the factory.

- ## Felddetails

  - ### DSFACTORY_KEY

    static final String DSFACTORY_KEY
    Key for the configuration which contains DataSourceFactories
    Siehe auch:
      - Konstantenfeldwerte

  - ### FACTORY_KEY

    static final String FACTORY_KEY
    Key for the configuration which contains the fully qualified name of the factory implementation class
    Siehe auch:
      - Konstantenfeldwerte

- ## Methodendetails

  - ### getDataSource

    DataSource getDataSource() throws TorqueException
    Gibt zurück:
      the `DataSource` configured by the factory.
    Löst aus:
      `TorqueException` - if the source can't be returned

  - ### initialize

    void initialize(org.apache.commons.configuration2.Configuration configuration) throws TorqueException
    Initialize the factory.
    Parameter:
      `configuration` - where to load the factory settings from
    Löst aus:
      `TorqueException` - Any exceptions caught during processing will be rethrown wrapped into a TorqueException.

  - ### close

    void close() throws TorqueException
    A hook which is called when the resources of the associated DataSource can be released. After close() is called, the other methods may not work any more (e.g. getDataSource() might return null). It is not guaranteed that this method does anything. For example, we do not want to close connections retrieved via JNDI, so the JndiDataSouurceFactory does not close these connections
    Löst aus:
      `TorqueException` - Any exceptions caught during processing will be rethrown wrapped into a TorqueException.