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 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 and Description
    --- | ---
    `static String` | `POOL_CLASS`
    `static String` | `POOL_SIZE`
    `static String` | `REPO_CLASS`
    `static String` | `REPO_URI`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MDPoolBean()`

  - ### Method Summary

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

      See Also:
        Constant Field Values

    - #### REPO_CLASS

          public static final String REPO_CLASS

      See Also:
        Constant Field Values

    - #### POOL_CLASS

          public static final String POOL_CLASS

      See Also:
        Constant Field Values

    - #### POOL_SIZE

          public static final String POOL_SIZE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MDPoolBean

          public MDPoolBean()

  - ### Method Detail

    - #### getName

          public 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 String getDefaultAlias()

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

    - #### registerConfigBean

          protected void registerConfigBean(String domain)

    - #### getConfigClass

          protected abstract Class<? extends T> getConfigClass()

      Returns per domain configuration class
      Returns:
        class

    - #### addRepo

          protected abstract void addRepo(String domain,
                                          S repo)

      Method called to add repo instance for domain

    - #### removeRepo

          protected abstract S removeRepo(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

Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.