类 AbstractRefreshableWebApplicationContext

java.lang.Object
cn.taketoday.core.io.DefaultResourceLoader
cn.taketoday.context.support.AbstractApplicationContext
cn.taketoday.context.support.AbstractRefreshableApplicationContext
cn.taketoday.context.support.AbstractRefreshableConfigApplicationContext
cn.taketoday.web.servlet.support.AbstractRefreshableWebApplicationContext
所有已实现的接口:
cn.taketoday.beans.factory.Aware, cn.taketoday.beans.factory.BeanFactory, cn.taketoday.beans.factory.BeanNameAware, cn.taketoday.beans.factory.HierarchicalBeanFactory, cn.taketoday.beans.factory.InitializingBean, cn.taketoday.beans.factory.support.BeanDefinitionRegistry, cn.taketoday.beans.factory.support.DependencyInjectorProvider, cn.taketoday.context.ApplicationContext, cn.taketoday.context.ApplicationEventPublisher, cn.taketoday.context.ConfigurableApplicationContext, cn.taketoday.context.Lifecycle, cn.taketoday.context.MessageSource, cn.taketoday.core.AliasRegistry, cn.taketoday.core.env.EnvironmentCapable, cn.taketoday.core.io.PatternResourceLoader, cn.taketoday.core.io.ResourceLoader, ConfigurableWebApplicationContext, WebApplicationContext, Closeable, AutoCloseable
直接已知子类:
AnnotationConfigWebApplicationContext, XmlWebApplicationContext

public abstract class AbstractRefreshableWebApplicationContext extends cn.taketoday.context.support.AbstractRefreshableConfigApplicationContext implements ConfigurableWebApplicationContext
AbstractRefreshableApplicationContext subclass which implements the ConfigurableWebApplicationContext interface for web environments. Provides a "configLocations" property, to be populated through the ConfigurableWebApplicationContext interface on web application startup.

This class is as easy to subclass as AbstractRefreshableApplicationContext: All you need to implements is the AbstractRefreshableApplicationContext.loadBeanDefinitions(cn.taketoday.beans.factory.support.StandardBeanFactory) method; see the superclass javadoc for details. Note that implementations are supposed to load bean definitions from the files specified by the locations returned by the getConfigLocations() method.

Interprets resource paths as servlet context resources, i.e. as paths beneath the web application root. Absolute paths, e.g. for files outside the web app root, can be accessed via "file:" URLs, as implemented by DefaultResourceLoader.

This is the web context to be subclassed for a different bean definition format.

Note that WebApplicationContext implementations are generally supposed to configure themselves based on the configuration received through the ConfigurableWebApplicationContext interface. In contrast, a standalone application context might allow for configuration in custom startup code (for example, GenericApplicationContext).

从以下版本开始:
4.0 2022/2/20 17:36
作者:
Juergen Hoeller, Harry Yang
另请参阅:
  • 嵌套类概要

    从类继承的嵌套类/接口 cn.taketoday.core.io.DefaultResourceLoader

    cn.taketoday.core.io.DefaultResourceLoader.ClassPathContextResource

    从接口继承的嵌套类/接口 cn.taketoday.context.ApplicationContext

    cn.taketoday.context.ApplicationContext.State
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    private String
    Namespace of this context, or null if root.
    Servlet config that this context runs in, if any.
    Servlet context that this context runs in.

    从类继承的字段 cn.taketoday.context.support.AbstractApplicationContext

    APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, log, MESSAGE_SOURCE_BEAN_NAME

    从接口继承的字段 cn.taketoday.context.ApplicationContext

    APPLICATION_NAME

    从接口继承的字段 cn.taketoday.beans.factory.BeanFactory

    FACTORY_BEAN_PREFIX

    从接口继承的字段 cn.taketoday.context.ConfigurableApplicationContext

    CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SHUTDOWN_HOOK_THREAD_NAME

    从接口继承的字段 cn.taketoday.web.servlet.ConfigurableWebApplicationContext

    SERVLET_CONFIG_BEAN_NAME

    从接口继承的字段 cn.taketoday.core.io.PatternResourceLoader

    CLASSPATH_ALL_URL_PREFIX

    从接口继承的字段 cn.taketoday.core.io.ResourceLoader

    CLASSPATH_URL_PREFIX
  • 构造器概要

    构造器
  • 方法概要

    修饰符和类型
    方法
    说明
    protected cn.taketoday.core.env.ConfigurableEnvironment
    Create and return a new StandardServletEnvironment.
     
    Return the config locations for this web application context, or null if none specified.
     
    Return the namespace for this web application context, if any.
    This implementation supports pattern matching in unexpanded WARs too.
    protected cn.taketoday.core.io.Resource
    This implementation supports file paths beneath the root of the ServletContext.
    Return the ServletConfig for this web application context, if any.
    Return the standard Servlet API ServletContext for this application.
    protected void
    protected void
    postProcessBeanFactory(cn.taketoday.beans.factory.config.ConfigurableBeanFactory beanFactory)
    Register request/session scopes, a ServletContextAwareProcessor, etc.
    void
    setNamespace(String namespace)
    Set the namespace for this web application context, to be used for building a default context config location.
    void
    Set the ServletConfig for this web application context.
    void
    Set the ServletContext for this web application context.

    从类继承的方法 cn.taketoday.context.support.AbstractRefreshableConfigApplicationContext

    afterPropertiesSet, getDefaultConfigLocations, resolvePath, setBeanName, setConfigLocation, setConfigLocations, setId

    从类继承的方法 cn.taketoday.context.support.AbstractRefreshableApplicationContext

    assertBeanFactoryActive, cancelRefresh, closeBeanFactory, containsBeanDefinition, containsBeanDefinition, containsBeanDefinition, containsBeanDefinition, createBeanFactory, createBootstrapContext, customizeBeanFactory, getAliasList, getBeanDefinition, getBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactory, hasBeanFactory, isAlias, isAllowBeanDefinitionOverriding, isBeanDefinitionOverridable, isBeanNameInUse, loadBeanDefinitions, refreshBeanFactory, registerAlias, registerBeanDefinition, removeAlias, removeBeanDefinition, setAllowBeanDefinitionOverriding, setAllowCircularReferences

    从类继承的方法 cn.taketoday.context.support.AbstractApplicationContext

    addApplicationListener, addBeanFactoryPostProcessor, applyState, close, containsBean, containsLocalBean, destroyBeans, doClose, findAllAnnotationsOnBean, findAnnotationOnBean, findAnnotationOnBean, findSynthesizedAnnotation, finishBeanFactoryInitialization, finishRefresh, formatStartupDate, getAliases, getAnnotatedBeans, getApplicationEventMulticaster, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBean, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeanProvider, getBeanProvider, getBeans, getBeansOfType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getBeansWithAnnotation, getBootstrapContext, getDisplayName, getEnvironment, getExpressionEvaluator, getId, getInjector, getInternalParentBeanFactory, getInternalParentMessageSource, getLifecycleProcessor, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResources, getStartupDate, getState, getType, getType, hasStarted, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, prepareBeanFactory, prepareRefresh, publishEvent, publishEvent, publishEvent, refresh, registerApplicationListeners, registerBeanPostProcessors, registerFrameworkComponents, registerShutdownHook, removeApplicationListener, resetCommonCaches, scan, setBootstrapContext, setDisplayName, setEnvironment, setParent, start, stop, toString, unwrapFactory

    从类继承的方法 cn.taketoday.core.io.DefaultResourceLoader

    addProtocolResolver, clearResourceCaches, getClassLoader, getProtocolResolvers, getResource, getResourceCache, setClassLoader

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    从接口继承的方法 cn.taketoday.core.AliasRegistry

    getAliases

    从接口继承的方法 cn.taketoday.context.ApplicationContext

    getAutowireCapableBeanFactory, getDisplayName, getExpressionEvaluator, getId, getParent, getStartupDate, getState, hasStarted, unwrapFactory

    从接口继承的方法 cn.taketoday.context.ApplicationEventPublisher

    publishEvent, publishEvent

    从接口继承的方法 cn.taketoday.beans.factory.BeanFactory

    containsBean, containsBeanDefinition, findAllAnnotationsOnBean, findAnnotationOnBean, findAnnotationOnBean, findSynthesizedAnnotation, getAliases, getAnnotatedBeans, getBean, getBean, getBean, getBean, getBean, getBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeanProvider, getBeanProvider, getBeans, getBeansOfType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getBeansWithAnnotation, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatch, unwrap

    从接口继承的方法 cn.taketoday.context.ConfigurableApplicationContext

    addApplicationListener, addBeanFactoryPostProcessor, addProtocolResolver, close, getBeanFactory, getBootstrapContext, getEnvironment, isActive, refresh, registerShutdownHook, removeApplicationListener, setClassLoader, setEnvironment, setId, setParent

    从接口继承的方法 cn.taketoday.web.servlet.ConfigurableWebApplicationContext

    setConfigLocation, setConfigLocations

    从接口继承的方法 cn.taketoday.beans.factory.support.DependencyInjectorProvider

    getInjector

    从接口继承的方法 cn.taketoday.beans.factory.HierarchicalBeanFactory

    containsLocalBean, getParentBeanFactory

    从接口继承的方法 cn.taketoday.context.Lifecycle

    isRunning, start, stop

    从接口继承的方法 cn.taketoday.context.MessageSource

    getMessage, getMessage, getMessage

    从接口继承的方法 cn.taketoday.core.io.PatternResourceLoader

    getResources, getResourcesArray, scan

    从接口继承的方法 cn.taketoday.core.io.ResourceLoader

    getClassLoader, getResource
  • 字段详细资料

    • servletContext

      @Nullable private ServletContext servletContext
      Servlet context that this context runs in.
    • servletConfig

      @Nullable private ServletConfig servletConfig
      Servlet config that this context runs in, if any.
    • namespace

      @Nullable private String namespace
      Namespace of this context, or null if root.
  • 构造器详细资料

    • AbstractRefreshableWebApplicationContext

      public AbstractRefreshableWebApplicationContext()
  • 方法详细资料

    • setServletContext

      public void setServletContext(@Nullable ServletContext servletContext)
      从接口复制的说明: ConfigurableWebApplicationContext
      Set the ServletContext for this web application context.

      Does not cause an initialization of the context: refresh needs to be called after the setting of all configuration properties.

      指定者:
      setServletContext 在接口中 ConfigurableWebApplicationContext
      另请参阅:
      • ConfigurableApplicationContext.refresh()
    • getServletContext

      @Nullable public ServletContext getServletContext()
      从接口复制的说明: WebApplicationContext
      Return the standard Servlet API ServletContext for this application.
      指定者:
      getServletContext 在接口中 WebApplicationContext
    • setServletConfig

      public void setServletConfig(@Nullable ServletConfig servletConfig)
      从接口复制的说明: ConfigurableWebApplicationContext
      Set the ServletConfig for this web application context. Only called for a WebApplicationContext that belongs to a specific Servlet.
      指定者:
      setServletConfig 在接口中 ConfigurableWebApplicationContext
      另请参阅:
      • ConfigurableApplicationContext.refresh()
    • getServletConfig

      @Nullable public ServletConfig getServletConfig()
      从接口复制的说明: ConfigurableWebApplicationContext
      Return the ServletConfig for this web application context, if any.
      指定者:
      getServletConfig 在接口中 ConfigurableWebApplicationContext
    • setNamespace

      public void setNamespace(@Nullable String namespace)
      从接口复制的说明: ConfigurableWebApplicationContext
      Set the namespace for this web application context, to be used for building a default context config location. The root web application context does not have a namespace.
      指定者:
      setNamespace 在接口中 ConfigurableWebApplicationContext
    • getNamespace

      @Nullable public String getNamespace()
      从接口复制的说明: ConfigurableWebApplicationContext
      Return the namespace for this web application context, if any.
      指定者:
      getNamespace 在接口中 ConfigurableWebApplicationContext
    • getContextPath

      public String getContextPath()
    • getConfigLocations

      public String[] getConfigLocations()
      从接口复制的说明: ConfigurableWebApplicationContext
      Return the config locations for this web application context, or null if none specified.
      指定者:
      getConfigLocations 在接口中 ConfigurableWebApplicationContext
      覆盖:
      getConfigLocations 在类中 cn.taketoday.context.support.AbstractRefreshableConfigApplicationContext
    • getApplicationName

      public String getApplicationName()
      指定者:
      getApplicationName 在接口中 cn.taketoday.context.ApplicationContext
      覆盖:
      getApplicationName 在类中 cn.taketoday.context.support.AbstractApplicationContext
    • createEnvironment

      protected cn.taketoday.core.env.ConfigurableEnvironment createEnvironment()
      Create and return a new StandardServletEnvironment. Subclasses may override in order to configure the environment or specialize the environment type returned.
      覆盖:
      createEnvironment 在类中 cn.taketoday.context.support.AbstractApplicationContext
    • postProcessBeanFactory

      protected void postProcessBeanFactory(cn.taketoday.beans.factory.config.ConfigurableBeanFactory beanFactory)
      Register request/session scopes, a ServletContextAwareProcessor, etc.
      覆盖:
      postProcessBeanFactory 在类中 cn.taketoday.context.support.AbstractApplicationContext
    • getResourceByPath

      protected cn.taketoday.core.io.Resource getResourceByPath(String path)
      This implementation supports file paths beneath the root of the ServletContext.
      覆盖:
      getResourceByPath 在类中 cn.taketoday.core.io.DefaultResourceLoader
      另请参阅:
    • getPatternResourceLoader

      protected ServletContextResourcePatternLoader getPatternResourceLoader()
      This implementation supports pattern matching in unexpanded WARs too.
      覆盖:
      getPatternResourceLoader 在类中 cn.taketoday.context.support.AbstractApplicationContext
      另请参阅:
    • initPropertySources

      protected void initPropertySources()

      Replace Servlet-related property sources.

      覆盖:
      initPropertySources 在类中 cn.taketoday.context.support.AbstractApplicationContext