org.apache.synapse.commons.datasource

## Class InMemoryDataSourceRepository

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

- All Implemented Interfaces:
    DataSourceRepository

      public class InMemoryDataSourceRepository
      extends java.lang.Object
      implements DataSourceRepository

  Keeps all DataSources in the memory

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `InMemoryDataSourceRepository()`

  - ### 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 properties)` Initialization with given properties
    `boolean` | `isInitialized()` Explicitly check for init
    `javax.sql.DataSource` | `lookUp(java.lang.String name)` Get a DataSource from Local store
    `void` | `register(DataSourceInformation dataSourceInformation)` Keep DataSource in the Local store.
    `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

    - #### 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(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 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(java.util.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`

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