Package org.apache.torque.dsfactory

# Klasse AbstractDataSourceFactory

java.lang.Object
org.apache.torque.dsfactory.AbstractDataSourceFactory

Alle implementierten Schnittstellen:
  `DataSourceFactory`

Bekannte direkte Unterklassen:
  `JndiDataSourceFactory`, `PerUserPool2DataSourceFactory`, `SharedPool2DataSourceFactory`

public abstract class AbstractDataSourceFactory extends Object implements DataSourceFactory
A class that contains common functionality of the factories in this package.

Version:
  $Id: AbstractDataSourceFactory.java 1917245 2024-04-21 14:06:23Z tv $
Autor:
  John McNally, Henning P. Schmiedehausen

- ## Feldübersicht

  Felder
  Modifizierer und Typ
  Feld
  Beschreibung
  `static final String`
  `CONNECTION_KEY`
  "connection" Key for the configuration
  `static final String`
  `DEFAULT_CONNECTION_KEY`
  "defaults.connection" Key for the configuration
  `static final String`
  `DEFAULT_POOL_KEY`
  "defaults.pool" Key for the configuration
  `static final String`
  `DEFAULTS_KEY`
  "defaults" Key for the configuration
  `static final String`
  `POOL_KEY`
  "pool" Key for the configuration
  `static boolean`
  `USE_DURATION_TEXT_FORMAT`
  if format described in `Duration.parse(CharSequence)` should be used.

  ### Von Schnittstelle geerbte Felder org.apache.torque.dsfactory.DataSourceFactory

  `DSFACTORY_KEY, FACTORY_KEY`

- ## Konstruktorübersicht

  Konstruktoren
  Konstruktor
  Beschreibung
  `AbstractDataSourceFactory()`

- ## Methodenübersicht

  Modifizierer und Typ
  Methode
  Beschreibung
  `void`
  `applyAndRemoveGlobal(org.apache.commons.configuration2.Configuration conf)`
  `protected void`
  `applyConfiguration(org.apache.commons.configuration2.Configuration c, Object o)`
  Iterate over a Configuration subset and apply all properties to a passed object which must contain Bean setter and getter
  `abstract DataSource`
  `getDataSource()`
  `protected void`
  `initCPDS(org.apache.commons.configuration2.Configuration configuration, ConnectionPoolDataSource cpds)`
  Initializes the ConnectionPoolDataSource.
  `abstract void`
  `initialize(org.apache.commons.configuration2.Configuration configuration)`
  Initialize the factory.
  `protected void`
  `initJdbc2Pool(DataSource dataSource, org.apache.commons.configuration2.Configuration configuration)`
  Initializes the Jdbc2PoolDataSource.
  `protected void`
  `setProperty(String property, org.apache.commons.configuration2.Configuration c, Object ds)`
  Encapsulates setting configuration properties on `DataSource` objects.

  ### Von Klasse geerbte Methoden java.lang.Object

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

  ### Von Schnittstelle geerbte Methoden org.apache.torque.dsfactory.DataSourceFactory

  `close`

- ## Felddetails

  - ### POOL_KEY

    public static final String POOL_KEY
    "pool" Key for the configuration
    Siehe auch:
      - Konstantenfeldwerte

  - ### CONNECTION_KEY

    public static final String CONNECTION_KEY
    "connection" Key for the configuration
    Siehe auch:
      - Konstantenfeldwerte

  - ### DEFAULTS_KEY

    public static final String DEFAULTS_KEY
    "defaults" Key for the configuration
    Siehe auch:
      - Konstantenfeldwerte

  - ### DEFAULT_POOL_KEY

    public static final String DEFAULT_POOL_KEY
    "defaults.pool" Key for the configuration
    Siehe auch:
      - Konstantenfeldwerte

  - ### DEFAULT_CONNECTION_KEY

    public static final String DEFAULT_CONNECTION_KEY
    "defaults.connection" Key for the configuration
    Siehe auch:
      - Konstantenfeldwerte

  - ### USE_DURATION_TEXT_FORMAT

    public static boolean USE_DURATION_TEXT_FORMAT
    if format described in `Duration.parse(CharSequence)` should be used.

- ## Konstruktordetails

  - ### AbstractDataSourceFactory

    public AbstractDataSourceFactory()

- ## Methodendetails

  - ### setProperty

    protected void setProperty(String property, org.apache.commons.configuration2.Configuration c, Object ds) throws Exception
    Encapsulates setting configuration properties on `DataSource` objects.
    Parameter:
      `property` - the property to read from the configuration
      `c` - the configuration to read the property from
      `ds` - the `DataSource` instance to write the property to
    Löst aus:
      `Exception` - if anything goes wrong

  - ### applyConfiguration

    protected void applyConfiguration(org.apache.commons.configuration2.Configuration c, Object o) throws TorqueException
    Iterate over a Configuration subset and apply all properties to a passed object which must contain Bean setter and getter
    Parameter:
      `c` - The configuration subset
      `o` - The object to apply the properties to
    Löst aus:
      `TorqueException` - if a property set fails

  - ### initCPDS

    protected void initCPDS(org.apache.commons.configuration2.Configuration configuration, ConnectionPoolDataSource cpds) throws TorqueException
    Initializes the ConnectionPoolDataSource.
    Parameter:
      `configuration` - where to read the settings from
      `cpds` - data source to configure
    Löst aus:
      `TorqueException` - if a property set fails

  - ### initJdbc2Pool

    protected void initJdbc2Pool(DataSource dataSource, org.apache.commons.configuration2.Configuration configuration) throws TorqueException
    Initializes the Jdbc2PoolDataSource.
    Parameter:
      `dataSource` - the dataSource to initialize, not null.
      `configuration` - where to read the settings from, not null.
    Löst aus:
      `TorqueException` - if a property set fails.

  - ### applyAndRemoveGlobal

    public void applyAndRemoveGlobal(org.apache.commons.configuration2.Configuration conf)

  - ### getDataSource

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

  - ### initialize

    public abstract void initialize(org.apache.commons.configuration2.Configuration configuration) throws TorqueException
    Initialize the factory.
    Angegeben von:
      `initialize` in Schnittstelle `DataSourceFactory`
    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.