Package org.apache.torque.dsfactory

# Klasse JndiDataSourceFactory

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

Alle implementierten Schnittstellen:
  `DataSourceFactory`

public class JndiDataSourceFactory extends AbstractDataSourceFactory
A factory that looks up the DataSource from JNDI. It is also able to deploy the DataSource based on properties found in the configuration. This factory tries to avoid excessive context lookups to improve speed. The time between two lookups can be configured. The default is 0 (no cache).

Version:
  $Id: JndiDataSourceFactory.java 1912328 2023-09-15 14:14:19Z gk $
Autor:
  John McNally, Thomas Vandahl

- ## Feldübersicht

  Felder
  Modifizierer und Typ
  Feld
  Beschreibung
  `static final String`
  `CLASSNAME_KEY`
  Key for the configuration property which contains the class name of the datasource to be bound into jndi.
  `static final String`
  `DATASOURCE_KEY`
  Key for the configuration which contains properties for a DataSource which should be bound into jndi.
  `static final String`
  `JNDI_KEY`
  Key for the configuration which contains jndi properties.
  `static final String`
  `PATH_KEY`
  Key for the configuration property which contains the jndi path.
  `static final String`
  `TIME_BETWEEN_LOOKUPS_KEY`
  Key for the configuration property which contains the time between two jndi lookups.

  ### Von Klasse geerbte Felder org.apache.torque.dsfactory.AbstractDataSourceFactory

  `CONNECTION_KEY, DEFAULT_CONNECTION_KEY, DEFAULT_POOL_KEY, DEFAULTS_KEY, POOL_KEY, USE_DURATION_TEXT_FORMAT`

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

  `DSFACTORY_KEY, FACTORY_KEY`

- ## Konstruktorübersicht

  Konstruktoren
  Konstruktor
  Beschreibung
  `JndiDataSourceFactory()`

- ## Methodenübersicht

  Modifizierer und Typ
  Methode
  Beschreibung
  `void`
  `close()`
  Does nothing.
  `DataSource`
  `getDataSource()`
  `void`
  `initialize(org.apache.commons.configuration2.Configuration configuration)`
  Initialize the factory.

  ### Von Klasse geerbte Methoden org.apache.torque.dsfactory.AbstractDataSourceFactory

  `applyAndRemoveGlobal, applyConfiguration, initCPDS, initJdbc2Pool, setProperty`

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

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

- ## Felddetails

  - ### JNDI_KEY

    public static final String JNDI_KEY
    Key for the configuration which contains jndi properties.
    Siehe auch:
      - Konstantenfeldwerte

  - ### PATH_KEY

    public static final String PATH_KEY
    Key for the configuration property which contains the jndi path.
    Siehe auch:
      - Konstantenfeldwerte

  - ### TIME_BETWEEN_LOOKUPS_KEY

    public static final String TIME_BETWEEN_LOOKUPS_KEY
    Key for the configuration property which contains the time between two jndi lookups.
    Siehe auch:
      - Konstantenfeldwerte

  - ### DATASOURCE_KEY

    public static final String DATASOURCE_KEY
    Key for the configuration which contains properties for a DataSource which should be bound into jndi.
    Siehe auch:
      - Konstantenfeldwerte

  - ### CLASSNAME_KEY

    public static final String CLASSNAME_KEY
    Key for the configuration property which contains the class name of the datasource to be bound into jndi.
    Siehe auch:
      - Konstantenfeldwerte

- ## Konstruktordetails

  - ### JndiDataSourceFactory

    public JndiDataSourceFactory()

- ## Methodendetails

  - ### getDataSource

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

  - ### initialize

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

  - ### close

    public void close()
    Does nothing. We do not want to close a dataSource retrieved from Jndi, because other applications might use it as well.