类 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
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
- 另请参阅:
-
AbstractRefreshableApplicationContext.loadBeanDefinitions(cn.taketoday.beans.factory.support.StandardBeanFactory)ConfigurableWebApplicationContext.setConfigLocations(java.lang.String...)
-
嵌套类概要
从类继承的嵌套类/接口 cn.taketoday.core.io.DefaultResourceLoader
cn.taketoday.core.io.DefaultResourceLoader.ClassPathContextResource从接口继承的嵌套类/接口 cn.taketoday.context.ApplicationContext
cn.taketoday.context.ApplicationContext.State -
字段概要
字段修饰符和类型字段说明private StringNamespace of this context, ornullif root.private ServletConfigServlet config that this context runs in, if any.private ServletContextServlet 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从接口继承的字段 cn.taketoday.web.servlet.WebApplicationContext
CONTEXT_ATTRIBUTES_BEAN_NAME, CONTEXT_PARAMETERS_BEAN_NAME, ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, SERVLET_CONTEXT_BEAN_NAME -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected cn.taketoday.core.env.ConfigurableEnvironmentCreate and return a newStandardServletEnvironment.String[]Return the config locations for this web application context, ornullif none specified.Return the namespace for this web application context, if any.protected ServletContextResourcePatternLoaderThis implementation supports pattern matching in unexpanded WARs too.protected cn.taketoday.core.io.ResourcegetResourceByPath(String path) 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 voidprotected voidpostProcessBeanFactory(cn.taketoday.beans.factory.config.ConfigurableBeanFactory beanFactory) Register request/session scopes, aServletContextAwareProcessor, etc.voidsetNamespace(String namespace) Set the namespace for this web application context, to be used for building a default context config location.voidsetServletConfig(ServletConfig servletConfig) Set the ServletConfig for this web application context.voidsetServletContext(ServletContext servletContext) 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
Servlet context that this context runs in. -
servletConfig
Servlet config that this context runs in, if any. -
namespace
Namespace of this context, ornullif root.
-
-
构造器详细资料
-
AbstractRefreshableWebApplicationContext
public AbstractRefreshableWebApplicationContext()
-
-
方法详细资料
-
setServletContext
从接口复制的说明:ConfigurableWebApplicationContextSet 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
从接口复制的说明:WebApplicationContextReturn the standard Servlet API ServletContext for this application.- 指定者:
getServletContext在接口中WebApplicationContext
-
setServletConfig
从接口复制的说明:ConfigurableWebApplicationContextSet the ServletConfig for this web application context. Only called for a WebApplicationContext that belongs to a specific Servlet.- 指定者:
setServletConfig在接口中ConfigurableWebApplicationContext- 另请参阅:
-
ConfigurableApplicationContext.refresh()
-
getServletConfig
从接口复制的说明:ConfigurableWebApplicationContextReturn the ServletConfig for this web application context, if any. -
setNamespace
从接口复制的说明:ConfigurableWebApplicationContextSet 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. -
getNamespace
从接口复制的说明:ConfigurableWebApplicationContextReturn the namespace for this web application context, if any. -
getContextPath
-
getConfigLocations
从接口复制的说明:ConfigurableWebApplicationContextReturn the config locations for this web application context, ornullif none specified.- 指定者:
getConfigLocations在接口中ConfigurableWebApplicationContext- 覆盖:
getConfigLocations在类中cn.taketoday.context.support.AbstractRefreshableConfigApplicationContext
-
getApplicationName
- 指定者:
getApplicationName在接口中cn.taketoday.context.ApplicationContext- 覆盖:
getApplicationName在类中cn.taketoday.context.support.AbstractApplicationContext
-
createEnvironment
protected cn.taketoday.core.env.ConfigurableEnvironment createEnvironment()Create and return a newStandardServletEnvironment. 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, aServletContextAwareProcessor, etc.- 覆盖:
postProcessBeanFactory在类中cn.taketoday.context.support.AbstractApplicationContext
-
getResourceByPath
This implementation supports file paths beneath the root of the ServletContext.- 覆盖:
getResourceByPath在类中cn.taketoday.core.io.DefaultResourceLoader- 另请参阅:
-
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
-