Class MDRepositoryBean<T extends DataSourceAware>

    • Field Detail

      • aliases

        @ConfigField(desc="Map of aliases for data sources to use")
        protected java.util.concurrent.ConcurrentHashMap<java.lang.String,​java.lang.String> aliases
    • Constructor Detail

      • MDRepositoryBean

        public MDRepositoryBean()
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns name of a bean
        name of a bean
      • setDataSourceBean

        public void setDataSourceBean​(DataSourceBean dataSourceBean)
      • registerIfNotExists

        public void registerIfNotExists​(java.lang.String name)
      • 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
        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
        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
      • findClassForDataSource

        protected abstract java.lang.Class<? extends T> findClassForDataSource​(DataSource dataSource)
                                                                        throws DBInitException
        Method returns class implementing repository which supports data source instance provided in parameter.
        repository class
      • repositoriesStream

        protected<T> repositoriesStream()
        Provides access to all available repository instances
        stream of repository instances
      • getRepositories

        protected java.util.Map<java.lang.String,​T> getRepositories()
        Provides access to unmodifiable map domain to repository instance
        map of domain to repository instance
      • getRepository

        protected T getRepository​(java.lang.String domain)
        Provides repository instance for passed domain name
        instance of repository
      • initializeRepository

        protected void initializeRepository​(java.lang.String domain,
                                            T repo)
        Method called to initialized passed repository instance for passed domain.
        Should be empty if no custom initialization is required.
      • updateDataSourceAware

        protected void updateDataSourceAware​(java.lang.String domain,
                                             T newRepo,
                                             T oldRepo)
        Method called when repository instance for domain changes.
        domain - name of domain
        newRepo - new instance of repository
        oldRepo - old instance of repository