org.apache.synapse.commons.datasource

## Class JNDIBasedDataSourceRepository

- java.lang.Object
- - org.apache.synapse.commons.datasource.JNDIBasedDataSourceRepository

- All Implemented Interfaces:
    DataSourceRepository

      public class JNDIBasedDataSourceRepository
      extends java.lang.Object
      implements DataSourceRepository

  Keep all DataSources in the JNDI Tree

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JNDIBasedDataSourceRepository()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clear already registered datasources
    `void` | `init(java.util.Properties jndiEnv)` Initialization with given properties
    `boolean` | `isInitialized()` Explicitly check for init
    `javax.sql.DataSource` | `lookUp(java.lang.String dsName)` Get a DatSource which has been registered in the JNDI tree
    `void` | `register(DataSourceInformation information)` Register a DataSource in the JNDI tree
    `void` | `unRegister(java.lang.String name)` Removing datasource

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

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

- - ### Constructor Detail

    - #### JNDIBasedDataSourceRepository

          public JNDIBasedDataSourceRepository()

  - ### Method Detail

    - #### init

          public void init(java.util.Properties jndiEnv)

      Description copied from interface: `DataSourceRepository`
      Initialization with given properties
      Specified by:
        `init` in interface `DataSourceRepository`
      Parameters:
        `jndiEnv` - configuration properties

    - #### register

          public void register(DataSourceInformation information)

      Register a DataSource in the JNDI tree
      Specified by:
        `register` in interface `DataSourceRepository`
      Parameters:
        `information` - DataSourceInformation instance
      See Also:
        `DataSourceRepository.register(DataSourceInformation)`

    - #### unRegister

          public void unRegister(java.lang.String name)

      Description copied from interface: `DataSourceRepository`
      Removing datasource
      Specified by:
        `unRegister` in interface `DataSourceRepository`
      Parameters:
        `name` - name of the datasource to be removed

    - #### lookUp

          public javax.sql.DataSource lookUp(java.lang.String dsName)

      Get a DatSource which has been registered in the JNDI tree
      Specified by:
        `lookUp` in interface `DataSourceRepository`
      Parameters:
        `dsName` - Name of the DataSource to be looked up
      Returns:
        DataSource Instance
      See Also:
        `DataSourceRepository.lookUp(String)`

    - #### clear

          public void clear()

      Description copied from interface: `DataSourceRepository`
      Clear already registered datasources
      Specified by:
        `clear` in interface `DataSourceRepository`

    - #### isInitialized

          public boolean isInitialized()

      Description copied from interface: `DataSourceRepository`
      Explicitly check for init
      Specified by:
        `isInitialized` in interface `DataSourceRepository`
      Returns:
        True , if has already initialized

Copyright © 2005-2022 Apache Software Foundation. All Rights Reserved.