public class BeanInstantiationGuard
extends java.lang.Object
implements org.springframework.beans.factory.config.BeanFactoryPostProcessor
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
targetName |
Constructor and Description |
---|
BeanInstantiationGuard(ReadOnlyStatus readOnly,
java.lang.String targetName)
Construct a bean instantiation guard.
|
Modifier and Type | Method and Description |
---|---|
void |
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory factory) |
protected void |
setBeanDefinitionForReadOnly(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
Act on the bean definition registry to make the target bean suitable for read-only mode.
|
void |
setIsWriteDb(boolean isWriteDb) |
void |
setIsWriteRepo(boolean isWriteRepo) |
public BeanInstantiationGuard(ReadOnlyStatus readOnly, java.lang.String targetName)
readOnly
- the read-only statustargetName
- the name of a bean that needs to writepublic void setIsWriteDb(boolean isWriteDb)
isWriteDb
- if the target bean needs to write to the database, defaults to false
public void setIsWriteRepo(boolean isWriteRepo)
isWriteRepo
- if the target bean needs to write to the repository, defaults to false
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory factory)
postProcessBeanFactory
in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
protected void setBeanDefinitionForReadOnly(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
registry
- the bean definition registry