Package org.apache.synapse.commons.datasource

## Class InMemoryDataSourceRepository

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

- All Implemented Interfaces:
    `DataSourceRepository`

      public class InMemoryDataSourceRepository
      extends Object
      implements DataSourceRepository

  Keeps all DataSources in the memory

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `InMemoryDataSourceRepository()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `clear()` | Clear already registered datasources
    `void` | `init​(Properties properties)` | Initialization with given properties
    `boolean` | `isInitialized()` | Explicitly check for init
    `DataSource` | `lookUp​(String name)` | Get a DataSource from Local store
    `void` | `register​(DataSourceInformation dataSourceInformation)` | Keep DataSource in the Local store.
    `void` | `unRegister​(String name)` | Removing datasource

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

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

- - ### Constructor Detail

    - #### InMemoryDataSourceRepository

          public InMemoryDataSourceRepository()

  - ### Method Detail

    - #### register

          public void register​(DataSourceInformation dataSourceInformation)

      Keep DataSource in the Local store.
      Specified by:
        `register` in interface `DataSourceRepository`
      Parameters:
        `dataSourceInformation` - the information describing a data source
      See Also:
        `DataSourceRepository.register(DataSourceInformation)`

    - #### unRegister

          public void unRegister​(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 DataSource lookUp​(String name)

      Get a DataSource from Local store
      Specified by:
        `lookUp` in interface `DataSourceRepository`
      Parameters:
        `name` - Name of the DataSource to be looked up
      Returns:
        DataSource Instance
      See Also:
        `DataSourceRepository.lookUp(String)`

    - #### init

          public void init​(Properties properties)

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

    - #### 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

    - #### clear

          public void clear()

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