Package tigase.db.beans

## Class MDPoolBean<S,​T extends MDPoolConfigBean<S,​T>>

- java.lang.Object
- - tigase.db.beans.MDPoolBean<S,​T>

- All Implemented Interfaces:
    `RegistrarBean`, `RegistrarBeanWithDefaultBeanClass`
  Direct Known Subclasses:
    `DataSourceBean`, `MDPoolBeanWithStatistics`

      public abstract class MDPoolBean<S,​T extends MDPoolConfigBean<S,​T>>
      extends java.lang.Object
      implements RegistrarBeanWithDefaultBeanClass

  Abstract class providing base part for implementation of pool for multiple domains.
  Created by andrzej on 08.03.2016.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static java.lang.String` | `POOL_CLASS` |
    `static java.lang.String` | `POOL_SIZE` |
    `static java.lang.String` | `REPO_CLASS` |
    `static java.lang.String` | `REPO_URI` |

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected abstract void` | `addRepo​(java.lang.String domain, S repo)` | Method called to add repo instance for domain
    `protected abstract java.lang.Class<? extends T>` | `getConfigClass()` | Returns per domain configuration class
    `java.lang.String` | `getDefaultAlias()` | Default alias used if for provided domain then is no repo instance.
    `java.lang.String` | `getName()` |
    `void` | `register​(Kernel kernel)` | Method called when bean is being registered allowing developer to programatically register other beans.
    `protected void` | `registerConfigBean​(java.lang.String domain)` |
    `protected abstract S` | `removeRepo​(java.lang.String domain)` | Method called to remove repo instance for domain
    `protected abstract void` | `setDefault​(S repo)` | Method called to set default repo instance.
    `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`

    - ### Methods inherited from interface tigase.kernel.beans.RegistrarBeanWithDefaultBeanClass

      `getDefaultBeanClass`

- - ### Field Detail

    - #### REPO_URI

          public static final java.lang.String REPO_URI

      See Also:
        Constant Field Values

    - #### REPO_CLASS

          public static final java.lang.String REPO_CLASS

      See Also:
        Constant Field Values

    - #### POOL_CLASS

          public static final java.lang.String POOL_CLASS

      See Also:
        Constant Field Values

    - #### POOL_SIZE

          public static final java.lang.String POOL_SIZE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MDPoolBean

          public MDPoolBean()

  - ### Method Detail

    - #### getName

          public java.lang.String getName()

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

    - #### getDefaultAlias

          public java.lang.String getDefaultAlias()

      Default alias used if for provided domain then is no repo instance.
      Returns:
        default alias

    - #### registerConfigBean

          protected void registerConfigBean​(java.lang.String domain)

    - #### getConfigClass

          protected abstract java.lang.Class<? extends T> getConfigClass()

      Returns per domain configuration class
      Returns:
        class

    - #### addRepo

          protected abstract void addRepo​(java.lang.String domain,
                                          S repo)

      Method called to add repo instance for domain

    - #### removeRepo

          protected abstract S removeRepo​(java.lang.String domain)

      Method called to remove repo instance for domain
      Returns:
        removed instance of repo

    - #### setDefault

          protected abstract void setDefault​(S repo)

      Method called to set default repo instance.
      Parameters:
        `repo` - instance of repo