Class 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
    • 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 status
        targetName - the name of a bean that needs to write
        substituteClass - 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: BeanInstantiationGuard
        Act on the bean definition registry to make the target bean suitable for read-only mode.
        Overrides:
        setBeanDefinitionForReadOnly in class BeanInstantiationGuard
        Parameters:
        registry - the bean definition registry