Class ClusterAwareBeanSelector
- java.lang.Object
-
- com.atlassian.confluence.impl.cluster.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 Summary
Constructors Constructor Description ClusterAwareBeanSelector(ClusterManager clusterManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
selectBean(Class<T> beanType, String beanNameForCluster, String beanNameForNonCluster)
Selects one of 2 beansvoid
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
-
-
-
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 beansbeanNameForCluster
- 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 interfaceorg.springframework.beans.factory.BeanFactoryAware
- Throws:
org.springframework.beans.BeansException
-
-