Class ClusterAwareBeanSelector

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware

    public class ClusterAwareBeanSelector
    extends Object
    implements org.springframework.beans.factory.BeanFactoryAware
    Responsible for selecting which of 2 beans should be used, depending on whether Confluence is clustered or not.
    Since:
    7.5
    • Constructor Detail

      • ClusterAwareBeanSelector

        public ClusterAwareBeanSelector​(ClusterManager clusterManager)
    • Method Detail

      • selectBean

        public <T> T selectBean​(Class<T> beanType,
                                String beanNameForCluster,
                                String beanNameForNonCluster)
        Selects one of 2 beans
        Parameters:
        beanType - The common base type of both beans
        beanNameForCluster - The name of the bean that should be selected if Confluence is in clustered mode.
        beanNameForNonCluster - The name of the bean that should be selected if Onfluence is NOT in clustered mode.
        Returns:
        The bean that was selected
      • setBeanFactory

        public void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory)
                            throws org.springframework.beans.BeansException
        Specified by:
        setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
        Throws:
        org.springframework.beans.BeansException