接口 EnvironmentCapable
- 所有已知子接口:
ApplicationContext
,ConfigurableApplicationContext
,ConfigurablePortletApplicationContext
,ConfigurableWebApplicationContext
,WebApplicationContext
- 所有已知实现类:
AbstractApplicationContext
,AbstractBeanDefinitionReader
,AbstractRefreshableApplicationContext
,AbstractRefreshableConfigApplicationContext
,AbstractRefreshablePortletApplicationContext
,AbstractRefreshableWebApplicationContext
,AbstractRequestLoggingFilter
,AbstractXmlApplicationContext
,AnnotationConfigApplicationContext
,AnnotationConfigWebApplicationContext
,CharacterEncodingFilter
,ClassPathBeanDefinitionScanner
,ClassPathScanningCandidateComponentProvider
,ClassPathXmlApplicationContext
,CommonsRequestLoggingFilter
,CorsFilter
,DelegatingFilterProxy
,DispatcherPortlet
,DispatcherServlet
,FileSystemXmlApplicationContext
,ForwardedHeaderFilter
,FrameworkPortlet
,FrameworkServlet
,GenericApplicationContext
,GenericFilterBean
,GenericGroovyApplicationContext
,GenericPortletBean
,GenericWebApplicationContext
,GenericXmlApplicationContext
,GroovyBeanDefinitionReader
,GroovyWebApplicationContext
,HiddenHttpMethodFilter
,HttpPutFormContentFilter
,HttpServletBean
,Log4jNestedDiagnosticContextFilter
,MultipartFilter
,OncePerRequestFilter
,OpenEntityManagerInViewFilter
,OpenPersistenceManagerInViewFilter
,OpenSessionInViewFilter
,OpenSessionInViewFilter
,OpenSessionInViewFilter
,PropertiesBeanDefinitionReader
,RelativeRedirectFilter
,RequestContextFilter
,ResourceAdapterApplicationContext
,ResourceServlet
,ResourceUrlEncodingFilter
,ServletContextRequestLoggingFilter
,ShallowEtagHeaderFilter
,StaticApplicationContext
,StaticPortletApplicationContext
,StaticWebApplicationContext
,XmlBeanDefinitionReader
,XmlPortletApplicationContext
,XmlWebApplicationContext
public interface EnvironmentCapable
Interface indicating a component that contains and exposes anEnvironment
reference.All Spring application contexts are EnvironmentCapable, and the interface is used primarily for performing
instanceof
checks in framework methods that accept BeanFactory instances that may or may not actually be ApplicationContext instances in order to interact with the environment if indeed it is available.As mentioned,
ApplicationContext
extends EnvironmentCapable, and thus exposes agetEnvironment()
method; however,ConfigurableApplicationContext
redefinesgetEnvironment()
and narrows the signature to return aConfigurableEnvironment
. The effect is that an Environment object is 'read-only' until it is being accessed from a ConfigurableApplicationContext, at which point it too may be configured.- 从以下版本开始:
- 3.1
- 作者:
- Chris Beams
- 另请参阅:
Environment
,ConfigurableEnvironment
,ConfigurableApplicationContext.getEnvironment()
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 Environment
getEnvironment()
Return theEnvironment
associated with this component (may benull
or a default environment).
方法详细资料
getEnvironment
Environment getEnvironment()
Return theEnvironment
associated with this component (may benull
or a default environment).