Class TenantedProxyFactory
- java.lang.Object
-
- com.atlassian.confluence.impl.tenant.TenantedProxyFactory
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanFactoryAware
public final class TenantedProxyFactory extends Object implements org.springframework.beans.factory.BeanFactoryAware
Responsible for creating proxy objects which check the tenancy state of the application before handing over to either a tenanted or vacant delegate.- Since:
- 7.5
-
-
Constructor Summary
Constructors Constructor Description TenantedProxyFactory(TenantRegistry tenantRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
createProxy(Class<T> beanType, String tenantedDelegateBeanName)
Create a tenancy-aware proxy for a given target type, which delegates to a designed target bean if there is a tenant, or throws an exception if there isn't.<T> T
createProxy(Class<T> beanType, String tenantedDelegateBeanName, String vacantDelegateBeanName)
Create a tenancy-aware proxy for a given target type, which delegates to either one of two target beans depending on tenancy state.void
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
-
-
-
Constructor Detail
-
TenantedProxyFactory
public TenantedProxyFactory(TenantRegistry tenantRegistry)
-
-
Method Detail
-
createProxy
public <T> T createProxy(Class<T> beanType, String tenantedDelegateBeanName, String vacantDelegateBeanName)
Create a tenancy-aware proxy for a given target type, which delegates to either one of two target beans depending on tenancy state.- Parameters:
beanType
- The common type of the delegate beanstenantedDelegateBeanName
- The name of the delegate bean to be used when there is a tenantvacantDelegateBeanName
- The name of the delegate bean to use when there isn't a tenant
-
createProxy
public <T> T createProxy(Class<T> beanType, String tenantedDelegateBeanName)
Create a tenancy-aware proxy for a given target type, which delegates to a designed target bean if there is a tenant, or throws an exception if there isn't.- Parameters:
beanType
- The common type of the delegate beanstenantedDelegateBeanName
- The name of the delegate bean to be used when there is a tenant
-
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
-
-