类 AbstractRefreshableConfigApplicationContext

java.lang.Object
cn.taketoday.core.io.DefaultResourceLoader
所有已实现的接口:
Aware, BeanFactory, BeanNameAware, HierarchicalBeanFactory, InitializingBean, BeanDefinitionRegistry, DependencyInjectorProvider, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, cn.taketoday.core.AliasRegistry, cn.taketoday.core.env.EnvironmentCapable, cn.taketoday.core.io.PatternResourceLoader, cn.taketoday.core.io.ResourceLoader, Closeable, AutoCloseable
直接已知子类:
AbstractXmlApplicationContext

public abstract class AbstractRefreshableConfigApplicationContext extends AbstractRefreshableApplicationContext implements BeanNameAware, InitializingBean
AbstractRefreshableApplicationContext subclass that adds common handling of specified config locations.
从以下版本开始:
4.0 2022/2/20 17:39
作者:
Juergen Hoeller, Harry Yang
另请参阅:
  • 构造器详细资料

    • AbstractRefreshableConfigApplicationContext

      public AbstractRefreshableConfigApplicationContext()
      Create a new AbstractRefreshableConfigApplicationContext with no parent.
    • AbstractRefreshableConfigApplicationContext

      public AbstractRefreshableConfigApplicationContext(@Nullable ApplicationContext parent)
      Create a new AbstractRefreshableConfigApplicationContext with the given parent context.
      参数:
      parent - the parent context
  • 方法详细资料

    • setConfigLocation

      public void setConfigLocation(String location)
      Set the config locations for this application context in init-param style, i.e. with distinct locations separated by commas, semicolons or whitespace.

      If not set, the implementation may use a default as appropriate.

    • setConfigLocations

      public void setConfigLocations(@Nullable String... locations)
      Set the config locations for this application context.

      If not set, the implementation may use a default as appropriate.

    • getConfigLocations

      @Nullable protected String[] getConfigLocations()
      Return an array of resource locations, referring to the XML bean definition files that this context should be built with. Can also include location patterns, which will get resolved via a ResourcePatternResolver.

      The default implementation returns null. Subclasses can override this to provide a set of resource locations to load bean definitions from.

      返回:
      an array of resource locations, or null if none
      另请参阅:
    • getDefaultConfigLocations

      @Nullable protected String[] getDefaultConfigLocations()
      Return the default config locations to use, for the case where no explicit config locations have been specified.

      The default implementation returns null, requiring explicit config locations.

      返回:
      an array of default config locations, if any
      另请参阅:
    • resolvePath

      protected String resolvePath(String path)
      Resolve the given path, replacing placeholders with corresponding environment property values if necessary. Applied to config locations.
      参数:
      path - the original file path
      返回:
      the resolved file path
      另请参阅:
      • PropertyResolver.resolveRequiredPlaceholders(String)
    • setId

      public void setId(String id)
      从类复制的说明: AbstractApplicationContext
      Set the unique id of this application context.

      Default is the object id of the context instance, or the name of the context bean if the context is itself defined as a bean.

      指定者:
      setId 在接口中 ConfigurableApplicationContext
      覆盖:
      setId 在类中 AbstractApplicationContext
      参数:
      id - the unique id of the context
    • setBeanName

      public void setBeanName(String name)
      Sets the id of this context to the bean name by default, for cases where the context instance is itself defined as a bean.
      指定者:
      setBeanName 在接口中 BeanNameAware
    • afterPropertiesSet

      public void afterPropertiesSet()
      Triggers AbstractApplicationContext.refresh() if not refreshed in the concrete context's constructor already.
      指定者:
      afterPropertiesSet 在接口中 InitializingBean