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 Details

  • Constructor Details

    • MDPoolBean

      public MDPoolBean()
  • Method Details

    • 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