Package tigase.db.beans

## Class SDRepositoryBean<A extends DataSourceAware>

- java.lang.Object
- - tigase.db.beans.SDRepositoryBean<A>

- All Implemented Interfaces:
    `ConfigurationChangedAware`, `Initializable`, `RegistrarBean`, `UnregisterAware`
  Direct Known Subclasses:
    `AbstractSDComponentRepositoryBean`, `SDRepositoryBeanWithStatistics`, `SeeOtherHostDB.SeeOtherHostDBSDRepositoryBean`

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

  Abstract class implementing bean to which can be used to create name unaware repository pool. This class is resposible for creation of correct repository instance for single specified data source.
  Created by andrzej on 17.08.2016.

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Abstract 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 abstract java.lang.Class<?>` | `findClassForDataSource​(DataSource dataSource)` |
    `java.lang.String` | `getDataSourceName()` |
    `java.lang.String` | `getName()` |
    `protected A` | `getRepository()` |
    `protected java.lang.Class<?>` | `getRepositoryClassName()` |
    `void` | `initialize()` | Method will be called, when bean will be created, configured and ready to use.
    `protected void` | `initializeRepository​(A repository)` |
    `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` | `setRepository​(A repository)` |
    `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`

- - ### Constructor Detail

    - #### SDRepositoryBean

          public SDRepositoryBean()

  - ### Method Detail

    - #### getDataSourceName

          public java.lang.String getDataSourceName()

    - #### getName

          public java.lang.String getName()

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

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

    - #### findClassForDataSource

          protected abstract java.lang.Class<?> findClassForDataSource​(DataSource dataSource)
                                                                throws DBInitException

      Throws:
        `DBInitException`

    - #### initializeRepository

          protected void initializeRepository​(A repository)

    - #### getRepository

          protected A getRepository()

    - #### setRepository

          public void setRepository​(A repository)

    - #### getRepositoryClassName

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

      Throws:
        `DBInitException`
        `java.lang.ClassNotFoundException`

    - #### onDataSourceChange

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