类 AbstractApplicationContextFactory

  • 所有已实现的接口:
    ApplicationContextFactory, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
    直接已知子类:
    GenericApplicationContextFactory

    public abstract class AbstractApplicationContextFactory
    extends java.lang.Object
    implements ApplicationContextFactory, org.springframework.context.ApplicationContextAware
    ApplicationContextFactory implementation that takes a parent context and a path to the context to create. When createApplicationContext method is called, the child ApplicationContext will be returned. The child context is not re-created every time it is requested, it is lazily initialized and cached. Clients should ensure that it is closed when it is no longer needed. If a path is not set, the parent will always be returned.
    • 方法概要

      所有方法 实例方法 抽象方法 具体方法 
      修饰符和类型方法说明
      org.springframework.context.ConfigurableApplicationContextcreateApplicationContext()
      Creates an ApplicationContext from the provided path.
      protected abstract org.springframework.context.ConfigurableApplicationContextcreateApplicationContext​(org.springframework.context.ConfigurableApplicationContext parent, java.lang.Object... resources) 
      booleanequals​(java.lang.Object obj) 
      protected java.util.Collection<java.lang.Class<? extends org.springframework.beans.factory.config.BeanFactoryPostProcessor>>getBeanFactoryPostProcessorClasses()
      Protected access to the list of bean factory post processor classes that should be copied over to the context from the parent.
      inthashCode() 
      protected booleanisCopyConfiguration()
      Protected access for subclasses to the flag determining whether configuration should be copied from parent context.
      protected voidprepareBeanFactory​(org.springframework.beans.factory.config.ConfigurableListableBeanFactory parent, org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
      Extension point for special subclasses that want to do more complex things with the bean factory prior to refresh.
      protected voidprepareContext​(org.springframework.context.ConfigurableApplicationContext parent, org.springframework.context.ConfigurableApplicationContext context)
      Extension point for special subclasses that want to do more complex things with the context prior to refresh.
      voidsetApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
      Setter for the parent application context.
      voidsetBeanFactoryPostProcessorClasses​(java.lang.Class<? extends org.springframework.beans.factory.config.BeanFactoryPostProcessor>[] beanFactoryPostProcessorClasses)
      Determines which bean factory post processors (like property placeholders) should be copied from the parent context.
      voidsetBeanPostProcessorExcludeClasses​(java.lang.Class<?>[] beanPostProcessorExcludeClasses)
      Determines by exclusion which bean post processors should be copied from the parent context.
      voidsetCopyConfiguration​(boolean copyConfiguration)
      Flag to indicate that configuration such as bean post processors and custom editors should be copied from the parent context.
      java.lang.StringtoString() 
      • 从类继承的方法 java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 构造器详细资料

      • AbstractApplicationContextFactory

        public AbstractApplicationContextFactory​(java.lang.Object... resource)
        Create a factory instance with the resource specified. The resources are Spring configuration files or java packages containing configuration files.
        参数:
        resource - resource to be used in the creation of the ApplicationContext.
    • 方法详细资料

      • setCopyConfiguration

        public void setCopyConfiguration​(boolean copyConfiguration)
        Flag to indicate that configuration such as bean post processors and custom editors should be copied from the parent context. Defaults to true.
        参数:
        copyConfiguration - the flag value to set
      • isCopyConfiguration

        protected final boolean isCopyConfiguration()
        Protected access for subclasses to the flag determining whether configuration should be copied from parent context.
        返回:
        the flag value
      • setBeanFactoryPostProcessorClasses

        public void setBeanFactoryPostProcessorClasses​(java.lang.Class<? extends org.springframework.beans.factory.config.BeanFactoryPostProcessor>[] beanFactoryPostProcessorClasses)
        Determines which bean factory post processors (like property placeholders) should be copied from the parent context. Defaults to PropertyPlaceholderConfigurer and CustomEditorConfigurer.
        参数:
        beanFactoryPostProcessorClasses - array of post processor types to be copied
      • setBeanPostProcessorExcludeClasses

        public void setBeanPostProcessorExcludeClasses​(java.lang.Class<?>[] beanPostProcessorExcludeClasses)
        Determines by exclusion which bean post processors should be copied from the parent context. Defaults to BeanFactoryAware (so any post processors that have a reference to the parent bean factory are not copied into the child). Note that these classes do not themselves have to be BeanPostProcessor implementations or sub-interfaces.
        参数:
        beanPostProcessorExcludeClasses - the classes to set
      • getBeanFactoryPostProcessorClasses

        protected final java.util.Collection<java.lang.Class<? extends org.springframework.beans.factory.config.BeanFactoryPostProcessor>> getBeanFactoryPostProcessorClasses()
        Protected access to the list of bean factory post processor classes that should be copied over to the context from the parent.
        返回:
        the classes for post processors that were nominated for copying
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Setter for the parent application context.
        指定者:
        setApplicationContext 在接口中 org.springframework.context.ApplicationContextAware
        抛出:
        org.springframework.beans.BeansException
        另请参阅:
        ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)
      • createApplicationContext

        protected abstract org.springframework.context.ConfigurableApplicationContext createApplicationContext​(org.springframework.context.ConfigurableApplicationContext parent,
                                                                                                               java.lang.Object... resources)
      • prepareContext

        protected void prepareContext​(org.springframework.context.ConfigurableApplicationContext parent,
                                      org.springframework.context.ConfigurableApplicationContext context)
        Extension point for special subclasses that want to do more complex things with the context prior to refresh. The default implementation does nothing.
        参数:
        parent - the parent for the new application context
        context - the new application context before it is refreshed, but after bean factory is initialized
        另请参阅:
        setBeanFactoryPostProcessorClasses(Class[])
      • prepareBeanFactory

        protected void prepareBeanFactory​(org.springframework.beans.factory.config.ConfigurableListableBeanFactory parent,
                                          org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
        Extension point for special subclasses that want to do more complex things with the bean factory prior to refresh. The default implementation copies all configuration from the parent according to the flag set.
        参数:
        parent - the parent bean factory for the new context (will never be null)
        beanFactory - the new bean factory before bean definitions are loaded
        另请参阅:
        setCopyConfiguration(boolean), DefaultListableBeanFactory.copyConfigurationFrom(ConfigurableBeanFactory)
      • toString

        public java.lang.String toString()
        覆盖:
        toString 在类中 java.lang.Object
      • hashCode

        public int hashCode()
        覆盖:
        hashCode 在类中 java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        覆盖:
        equals 在类中 java.lang.Object