org.apache.synapse.commons.datasource

## Class DataSourceRepositoryManager

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

- All Implemented Interfaces:
    DataSourceInformationRepositoryListener

      public class DataSourceRepositoryManager
      extends java.lang.Object
      implements DataSourceInformationRepositoryListener

  Manages data sources defined in the synapse. This is an observer of the DataSourceInformationRepository

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataSourceRepositoryManager(InMemoryDataSourceRepository inMemoryDataSourceRepository, JNDIBasedDataSourceRepository jndiBasedDataSourceRepository)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDataSourceInformation(DataSourceInformation dataSourceInformation)` Event when adding a DataSourceInformation
    `void` | `clear()` Clear all DataSource Repositories
    `javax.sql.DataSource` | `getDataSource(java.lang.String name)` Find a DataSource using given name
    `void` | `reConfigure(java.util.Properties confProperties)` Event when re-configuring the DataSourceInformationRepository
    `void` | `removeDataSourceInformation(DataSourceInformation dataSourceInformation)` Event when removing a DataSourceInformation instance

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

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

- - ### Constructor Detail

    - #### DataSourceRepositoryManager

          public DataSourceRepositoryManager(InMemoryDataSourceRepository inMemoryDataSourceRepository,
                                             JNDIBasedDataSourceRepository jndiBasedDataSourceRepository)

  - ### Method Detail

    - #### getDataSource

          public javax.sql.DataSource getDataSource(java.lang.String name)

      Find a DataSource using given name
      Parameters:
        `name` - Name of the DataSource to be found
      Returns:
        DataSource if found , otherwise null

    - #### addDataSourceInformation

          public void addDataSourceInformation(DataSourceInformation dataSourceInformation)

      Description copied from interface: `DataSourceInformationRepositoryListener`
      Event when adding a DataSourceInformation
      Specified by:
        `addDataSourceInformation` in interface `DataSourceInformationRepositoryListener`
      Parameters:
        `dataSourceInformation` - added DataSourceInformation instance

    - #### removeDataSourceInformation

          public void removeDataSourceInformation(DataSourceInformation dataSourceInformation)

      Description copied from interface: `DataSourceInformationRepositoryListener`
      Event when removing a DataSourceInformation instance
      Specified by:
        `removeDataSourceInformation` in interface `DataSourceInformationRepositoryListener`
      Parameters:
        `dataSourceInformation` - removed DataSourceInformation instance

    - #### reConfigure

          public void reConfigure(java.util.Properties confProperties)

      Description copied from interface: `DataSourceInformationRepositoryListener`
      Event when re-configuring the DataSourceInformationRepository
      Specified by:
        `reConfigure` in interface `DataSourceInformationRepositoryListener`
      Parameters:
        `confProperties` - properties used to configure DataSourceInformationRepository

    - #### clear

          public void clear()

      Clear all DataSource Repositories

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