クラス StaticWebApplicationContext
java.lang.ObjectSE
org.springframework.core.io.DefaultResourceLoader
org.springframework.context.support.AbstractApplicationContext
org.springframework.context.support.GenericApplicationContext
org.springframework.context.support.StaticApplicationContext
org.springframework.web.context.support.StaticWebApplicationContext
- 実装済みのインターフェース一覧:
CloseableSE, AutoCloseableSE, BeanFactory, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, AliasRegistry, EnvironmentCapable, ResourceLoader, ResourcePatternResolver, ConfigurableWebApplicationContext, WebApplicationContext
public class StaticWebApplicationContext
extends StaticApplicationContext
implements ConfigurableWebApplicationContext
テスト用の静的
WebApplicationContext 実装。本番アプリケーションでの使用を目的としていません。ConfigurableWebApplicationContext インターフェースを実装して、外部構成ファイルを実際にサポートしていないにもかかわらず、XmlWebApplicationContext の直接置換を可能にします。
リソースパスをサーブレットコンテキストリソース、つまり Web アプリケーションルートのパスとして解釈します。たとえば、Web アプリケーションルート外のファイルの絶対パスは、DefaultResourceLoader によって実装されている "file:" URL を介してアクセスできます。
- 作成者:
- Rod Johnson, Juergen Hoeller
ネストされたクラスの概要
クラス DefaultResourceLoader から継承されたネストクラス / インターフェース
DefaultResourceLoader.ClassPathContextResourceフィールド概要
クラス AbstractApplicationContext から継承されたフィールド
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAMEインターフェース BeanFactory から継承されたフィールド
FACTORY_BEAN_PREFIX, FACTORY_BEAN_PREFIX_CHARインターフェース ConfigurableApplicationContext から継承されたフィールド
APPLICATION_STARTUP_BEAN_NAME, BOOTSTRAP_EXECUTOR_BEAN_NAME, CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, ENVIRONMENT_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SHUTDOWN_HOOK_THREAD_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAMEインターフェース ConfigurableWebApplicationContext から継承されたフィールド
APPLICATION_CONTEXT_ID_PREFIX, SERVLET_CONFIG_BEAN_NAMEインターフェース ResourceLoader から継承されたフィールド
CLASSPATH_URL_PREFIXインターフェース ResourcePatternResolver から継承されたフィールド
CLASSPATH_ALL_URL_PREFIXコンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明protected ConfigurableEnvironment新しいStandardServletEnvironmentを作成して返します。この Web アプリケーションコンテキストの設定場所を返します。指定がない場合はnullを返します。この Web アプリケーションコンテキストのネームスペースがあれば、それを返します。protected ResourcegetResourceByPath(StringSE path) この実装は、ServletContext のルートのファイルパスをサポートします。protected ResourcePatternResolverこの実装は、拡張されていない WAR のパターンマッチングもサポートします。@Nullable jakarta.servlet.ServletConfigこの Web アプリケーションコンテキストの ServletConfig を返します(存在する場合)。@Nullable jakarta.servlet.ServletContextこのアプリケーションの標準サーブレット API ServletContext を返します。protected voidスタブプロパティソースを実際のインスタンスに置き換えます。protected voidpostProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) リクエスト / セッションスコープ、ServletContextAwareProcessorなどを登録します。voidsetConfigLocation(StringSE configLocation) StaticWebApplicationContextクラスはこのメソッドをサポートしていません。voidsetConfigLocations(StringSE... configLocations) StaticWebApplicationContextクラスはこのメソッドをサポートしていません。voidsetNamespace(@Nullable StringSE namespace) この Web アプリケーションコンテキストのネームスペースを設定して、デフォルトのコンテキスト設定場所の構築に使用します。voidsetServletConfig(@Nullable jakarta.servlet.ServletConfig servletConfig) この Web アプリケーションコンテキストの ServletConfig を設定します。voidsetServletContext(@Nullable jakarta.servlet.ServletContext servletContext) この WebApplicationContext が実行される ServletContext を設定します。クラス StaticApplicationContext から継承されたメソッド
addMessage, assertBeanFactoryActive, getStaticMessageSource, registerPrototype, registerPrototype, registerSingleton, registerSingletonクラス GenericApplicationContext から継承されたメソッド
cancelRefresh, closeBeanFactory, getAutowireCapableBeanFactory, getBeanDefinition, getBeanFactory, getClassLoader, getDefaultListableBeanFactory, getResource, getResources, isAlias, isBeanDefinitionOverridable, isBeanNameInUse, refreshBeanFactory, refreshForAotProcessing, register, registerAlias, registerBean, registerBean, registerBean, registerBean, registerBean, registerBean, registerBeanDefinition, removeAlias, removeBeanDefinition, setAllowBeanDefinitionOverriding, setAllowCircularReferences, setApplicationStartup, setClassLoader, setParent, setResourceLoaderクラス AbstractApplicationContext から継承されたメソッド
addApplicationListener, addBeanFactoryPostProcessor, clearResourceCaches, close, containsBean, containsBeanDefinition, containsLocalBean, destroyBeans, doClose, findAllAnnotationsOnBean, findAnnotationOnBean, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getApplicationName, getApplicationStartup, getBean, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeanProvider, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getEnvironment, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getStartupDate, getType, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isClosed, isPrototype, isRunning, isSingleton, isTypeMatch, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, pause, prepareBeanFactory, prepareRefresh, publishEvent, publishEvent, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, removeApplicationListener, resetCommonCaches, restart, setDisplayName, setEnvironment, setId, start, stop, toStringクラス DefaultResourceLoader から継承されたメソッド
addProtocolResolver, getProtocolResolvers, getResourceCacheクラス ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース AliasRegistry から継承されたメソッド
getAliasesインターフェース ApplicationContext から継承されたメソッド
getApplicationName, getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDateインターフェース ApplicationEventPublisher から継承されたメソッド
publishEvent, publishEventインターフェース BeanDefinitionRegistry から継承されたメソッド
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNamesインターフェース BeanFactory から継承されたメソッド
containsBean, getAliases, getBean, getBean, getBean, getBean, getBean, getBeanProvider, getBeanProvider, getBeanProvider, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatchインターフェース ConfigurableApplicationContext から継承されたメソッド
addApplicationListener, addBeanFactoryPostProcessor, addProtocolResolver, close, getApplicationStartup, getBeanFactory, getEnvironment, isActive, isClosed, pause, refresh, registerShutdownHook, removeApplicationListener, restart, setApplicationStartup, setClassLoader, setEnvironment, setId, setParentインターフェース HierarchicalBeanFactory から継承されたメソッド
containsLocalBean, getParentBeanFactoryインターフェース ListableBeanFactory から継承されたメソッド
containsBeanDefinition, findAllAnnotationsOnBean, findAnnotationOnBean, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotationインターフェース MessageSource から継承されたメソッド
getMessage, getMessage, getMessageインターフェース ResourceLoader から継承されたメソッド
getClassLoader, getResourceインターフェース ResourcePatternResolver から継承されたメソッド
getResources
コンストラクターの詳細
StaticWebApplicationContext
public StaticWebApplicationContext()
メソッドの詳細
setServletContext
この WebApplicationContext が実行される ServletContext を設定します。- 次で指定:
- インターフェース
ConfigurableWebApplicationContextのsetServletContext - 関連事項:
getServletContext
インターフェースからコピーされた説明:WebApplicationContextこのアプリケーションの標準サーブレット API ServletContext を返します。- 次で指定:
- インターフェース
WebApplicationContextのgetServletContext
setServletConfig
インターフェースからコピーされた説明:ConfigurableWebApplicationContextこの Web アプリケーションコンテキストの ServletConfig を設定します。特定のサーブレットに属する WebApplicationContext に対してのみ呼び出されます。- 次で指定:
- インターフェース
ConfigurableWebApplicationContextのsetServletConfig - 関連事項:
getServletConfig
インターフェースからコピーされた説明:ConfigurableWebApplicationContextこの Web アプリケーションコンテキストの ServletConfig を返します(存在する場合)。- 次で指定:
- インターフェース
ConfigurableWebApplicationContextのgetServletConfig
setNamespace
インターフェースからコピーされた説明:ConfigurableWebApplicationContextこの Web アプリケーションコンテキストのネームスペースを設定して、デフォルトのコンテキスト設定場所の構築に使用します。ルート Web アプリケーションコンテキストには名前空間がありません。- 次で指定:
- インターフェース
ConfigurableWebApplicationContextのsetNamespace
getNamespace
インターフェースからコピーされた説明:ConfigurableWebApplicationContextこの Web アプリケーションコンテキストのネームスペースがあれば、それを返します。- 次で指定:
- インターフェース
ConfigurableWebApplicationContextのgetNamespace
setConfigLocation
StaticWebApplicationContextクラスはこのメソッドをサポートしていません。- 次で指定:
- インターフェース
ConfigurableWebApplicationContextのsetConfigLocation - 例外:
UnsupportedOperationExceptionSE- 常に
setConfigLocations
StaticWebApplicationContextクラスはこのメソッドをサポートしていません。- 次で指定:
- インターフェース
ConfigurableWebApplicationContextのsetConfigLocations - 例外:
UnsupportedOperationExceptionSE- 常に
getConfigLocations
インターフェースからコピーされた説明:ConfigurableWebApplicationContextこの Web アプリケーションコンテキストの設定場所を返します。指定がない場合はnullを返します。- 次で指定:
- インターフェース
ConfigurableWebApplicationContextのgetConfigLocations
postProcessBeanFactory
リクエスト / セッションスコープ、ServletContextAwareProcessorなどを登録します。- オーバーライド:
- クラス
AbstractApplicationContextのpostProcessBeanFactory - パラメーター:
beanFactory- アプリケーションコンテキストで使用される Bean ファクトリ
getResourceByPath
この実装は、ServletContext のルートのファイルパスをサポートします。- オーバーライド:
- クラス
DefaultResourceLoaderのgetResourceByPath - パラメーター:
path- リソースへのパス- 戻り値:
- 対応するリソースハンドル
- 関連事項:
getResourcePatternResolver
この実装は、拡張されていない WAR のパターンマッチングもサポートします。- オーバーライド:
- クラス
AbstractApplicationContextのgetResourcePatternResolver - 戻り値:
- このコンテキストの ResourcePatternResolver
- 関連事項:
createEnvironment
新しいStandardServletEnvironmentを作成して返します。- オーバーライド:
- クラス
AbstractApplicationContextのcreateEnvironment
initPropertySources
protected void initPropertySources()クラスからコピーされた説明:AbstractApplicationContextスタブプロパティソースを実際のインスタンスに置き換えます。
- オーバーライド:
- クラス
AbstractApplicationContextのinitPropertySources - 関連事項: