Package tigase.db.beans

## Class MDRepositoryBean.MDRepositoryConfigBean<A extends DataSourceAware>

- java.lang.Object
- - tigase.db.beans.MDRepositoryBean.MDRepositoryConfigBean<A>

- All Implemented Interfaces:
    `ConfigurationChangedAware`, `Initializable`, `RegistrarBean`, `UnregisterAware`
  Direct Known Subclasses:
    `CounterDataLoggerRepoBean.CounterDataLoggerConfigBean`, `MsgBroadcastRepository.MsgBroadcastRepositoryBean.MsgBroadcastRepositoryConfigBean`, `MsgRepository.MsgRepositoryMDBean.MsgRepositoryConfigBean`, `SeeOtherHostDualIP.DualIPRepositoryWrapper.DualIPRepositoryWrapperConfigBean`
  Enclosing class:
    MDRepositoryBean<T extends DataSourceAware>

      public abstract static class MDRepositoryBean.MDRepositoryConfigBean<A extends DataSourceAware>
      extends java.lang.Object
      implements Initializable, UnregisterAware, ConfigurationChangedAware, RegistrarBean

  MDRepositoryConfigBean is bean responsible for basic management and initialization of repository for domain.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected DataSourceBean` | `dataSourceBean` |

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `beanConfigurationChanged​(java.util.Collection<java.lang.String> changedFields)` | Method called when configuration was applied to bean.
    `void` | `beforeUnregister()` | Method called before bean unregister.
    `protected java.lang.String` | `getCls()` |
    `protected java.lang.Class<?>` | `getRepositoryClassName()` | Method returns class for instance repository matching data source or returning class specified in `cls` config field.
    `void` | `initialize()` | Method will be called, when bean will be created, configured and ready to use.
    `protected void` | `onDataSourceChange​(DataSourceBean.DataSourceChangedEvent event)` |
    `void` | `register​(Kernel kernel)` | Method called when bean is being registered allowing developer to programatically register other beans.
    `void` | `setDataSourceAware​(A dataSourceAware)` |
    `void` | `unregister​(Kernel kernel)` | Method called while bean is being unregistered.

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

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

- - ### Field Detail

    - #### dataSourceBean

          @Inject
          protected DataSourceBean dataSourceBean

  - ### Constructor Detail

    - #### MDRepositoryConfigBean

          public MDRepositoryConfigBean()

  - ### Method Detail

    - #### beanConfigurationChanged

          public void beanConfigurationChanged​(java.util.Collection<java.lang.String> changedFields)

      Description copied from interface: `ConfigurationChangedAware`
      Method called when configuration was applied to bean.
      Specified by:
        `beanConfigurationChanged` in interface `ConfigurationChangedAware`
      Parameters:
        `changedFields` - collection of field names which were changed

    - #### setDataSourceAware

          public void setDataSourceAware​(A dataSourceAware)

    - #### register

          public void register​(Kernel kernel)

      Description copied from interface: `RegistrarBean`
      Method called when bean is being registered allowing developer to programatically register other beans.
      Specified by:
        `register` in interface `RegistrarBean`
      Parameters:
        `kernel` - - instance from local scope

    - #### unregister

          public void unregister​(Kernel kernel)

      Description copied from interface: `RegistrarBean`
      Method called while bean is being unregistered.
      Specified by:
        `unregister` in interface `RegistrarBean`
      Parameters:
        `kernel` - - instance from local scope

    - #### initialize

          public void initialize()

      Description copied from interface: `Initializable`
      Method will be called, when bean will be created, configured and ready to use.
      Specified by:
        `initialize` in interface `Initializable`

    - #### beforeUnregister

          public void beforeUnregister()

      Description copied from interface: `UnregisterAware`
      Method called before bean unregister.
      Specified by:
        `beforeUnregister` in interface `UnregisterAware`

    - #### getRepositoryClassName

          protected java.lang.Class<?> getRepositoryClassName()
                                                       throws DBInitException,
                                                              java.lang.ClassNotFoundException

      Method returns class for instance repository matching data source or returning class specified in `cls` config field.
      Throws:
        `DBInitException`
        `java.lang.ClassNotFoundException`

    - #### getCls

          protected java.lang.String getCls()

    - #### onDataSourceChange

          @HandleEvent
          protected void onDataSourceChange​(DataSourceBean.DataSourceChangedEvent event)