类 StaticWebApplicationContext
java.lang.Object
cn.taketoday.core.io.DefaultResourceLoader
cn.taketoday.context.support.AbstractApplicationContext
cn.taketoday.context.support.GenericApplicationContext
cn.taketoday.context.support.StaticApplicationContext
cn.taketoday.web.servlet.support.StaticWebApplicationContext
- 所有已实现的接口:
cn.taketoday.beans.factory.BeanFactory,cn.taketoday.beans.factory.HierarchicalBeanFactory,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
public class StaticWebApplicationContext
extends cn.taketoday.context.support.StaticApplicationContext
implements ConfigurableWebApplicationContext
Static
WebApplicationContext
implementation for testing. Not intended for use in production applications.
Implements the ConfigurableWebApplicationContext
interface to allow for direct replacement of an XmlWebApplicationContext,
despite not actually supporting external configuration files.
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.
- 从以下版本开始:
- 4.0 2022/2/7 13:52
- 作者:
- Rod Johnson, Juergen Hoeller, Harry Yang
-
嵌套类概要
从类继承的嵌套类/接口 cn.taketoday.core.io.DefaultResourceLoader
cn.taketoday.core.io.DefaultResourceLoader.ClassPathContextResource从接口继承的嵌套类/接口 cn.taketoday.context.ApplicationContext
cn.taketoday.context.ApplicationContext.State -
字段概要
字段从类继承的字段 cn.taketoday.context.support.GenericApplicationContext
beanFactory从类继承的字段 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.voidsetConfigLocation(String configLocation) TheStaticWebApplicationContextclass does not support this method.voidsetConfigLocations(String... configLocations) TheStaticWebApplicationContextclass does not support this method.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 that this WebApplicationContext runs in.从类继承的方法 cn.taketoday.context.support.StaticApplicationContext
addMessage, assertBeanFactoryActive, getStaticMessageSource从类继承的方法 cn.taketoday.context.support.GenericApplicationContext
cancelRefresh, closeBeanFactory, containsBeanDefinition, containsBeanDefinition, containsBeanDefinition, createBootstrapContext, getAliasList, getAutowireCapableBeanFactory, getBeanDefinition, getBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactory, getClassLoader, getResource, getResources, isAlias, isAllowBeanDefinitionOverriding, isBeanDefinitionOverridable, isBeanNameInUse, refreshBeanFactory, refreshForAotProcessing, registerAlias, registerBean, registerBean, registerBean, registerBean, registerBean, registerBean, registerBeanDefinition, registerPrototype, registerPrototype, registerSingleton, registerSingleton, registerSingleton, registerSingleton, removeAlias, removeBeanDefinition, scan, setAllowBeanDefinitionOverriding, setAllowCircularReferences, setClassLoader, setParent, setResourceLoader从类继承的方法 cn.taketoday.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, applyState, close, containsBean, containsLocalBean, destroyBeans, doClose, findAllAnnotationsOnBean, findAnnotationOnBean, findAnnotationOnBean, findSynthesizedAnnotation, finishBeanFactoryInitialization, finishRefresh, formatStartupDate, getAliases, getAnnotatedBeans, getApplicationEventMulticaster, getApplicationListeners, getApplicationName, 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, 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, setBootstrapContext, setDisplayName, setEnvironment, setId, start, stop, toString, unwrapFactory从类继承的方法 cn.taketoday.core.io.DefaultResourceLoader
addProtocolResolver, clearResourceCaches, getProtocolResolvers, getResourceCache从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 cn.taketoday.core.AliasRegistry
getAliases从接口继承的方法 cn.taketoday.context.ApplicationContext
getApplicationName, getAutowireCapableBeanFactory, getDisplayName, getExpressionEvaluator, getId, getParent, getStartupDate, getState, hasStarted, unwrapFactory从接口继承的方法 cn.taketoday.context.ApplicationEventPublisher
publishEvent, publishEvent从接口继承的方法 cn.taketoday.beans.factory.support.BeanDefinitionRegistry
containsBeanDefinition从接口继承的方法 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.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
-
servletConfig
-
namespace
-
-
构造器详细资料
-
StaticWebApplicationContext
public StaticWebApplicationContext() -
StaticWebApplicationContext
-
-
方法详细资料
-
setServletContext
Set the ServletContext that this WebApplicationContext runs in.- 指定者:
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. -
setConfigLocation
TheStaticWebApplicationContextclass does not support this method.- 指定者:
setConfigLocation在接口中ConfigurableWebApplicationContext- 抛出:
UnsupportedOperationException- always
-
setConfigLocations
TheStaticWebApplicationContextclass does not support this method.- 指定者:
setConfigLocations在接口中ConfigurableWebApplicationContext- 抛出:
UnsupportedOperationException- always
-
getConfigLocations
从接口复制的说明:ConfigurableWebApplicationContextReturn the config locations for this web application context, ornullif none specified. -
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- 另请参阅:
-
createEnvironment
protected cn.taketoday.core.env.ConfigurableEnvironment createEnvironment()Create and return a newStandardServletEnvironment.- 覆盖:
createEnvironment在类中cn.taketoday.context.support.AbstractApplicationContext
-
initPropertySources
protected void initPropertySources()- 覆盖:
initPropertySources在类中cn.taketoday.context.support.AbstractApplicationContext
-