Package ome.services.util
Class BeanInstantiationSubstituter
- java.lang.Object
-
- ome.services.util.BeanInstantiationGuard
-
- ome.services.util.BeanInstantiationSubstituter
-
- All Implemented Interfaces:
org.springframework.beans.factory.config.BeanFactoryPostProcessor
public class BeanInstantiationSubstituter extends BeanInstantiationGuard
Adjusts instantiation class of Spring beans based on read-only status.- Since:
- 5.4.6
-
-
Field Summary
-
Fields inherited from class ome.services.util.BeanInstantiationGuard
targetName
-
-
Constructor Summary
Constructors Constructor Description BeanInstantiationSubstituter(ReadOnlyStatus readOnly, java.lang.String targetName, java.lang.String substituteClass)Construct a bean instantiation substituter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidsetBeanDefinitionForReadOnly(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)Act on the bean definition registry to make the target bean suitable for read-only mode.-
Methods inherited from class ome.services.util.BeanInstantiationGuard
postProcessBeanFactory, setIsWriteDb, setIsWriteRepo
-
-
-
-
Constructor Detail
-
BeanInstantiationSubstituter
public BeanInstantiationSubstituter(ReadOnlyStatus readOnly, java.lang.String targetName, java.lang.String substituteClass)
Construct a bean instantiation substituter.- Parameters:
readOnly- the read-only statustargetName- the name of a bean that needs to writesubstituteClass- the name of the class implementing the read-only variant of the bean
-
-
Method Detail
-
setBeanDefinitionForReadOnly
protected void setBeanDefinitionForReadOnly(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
Description copied from class:BeanInstantiationGuardAct on the bean definition registry to make the target bean suitable for read-only mode.- Overrides:
setBeanDefinitionForReadOnlyin classBeanInstantiationGuard- Parameters:
registry- the bean definition registry
-
-