Interface EnvironmentCapable
Environment 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,
invalid reference
ApplicationContextgetEnvironment() method; however,
invalid reference
ConfigurableApplicationContextinvalid reference
getEnvironment()ConfigurableEnvironment.
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.
- Since:
- 3.1
- Author:
- Chris Beams
- See Also:
-
Method Summary
-
Method Details
-
getEnvironment
Environment getEnvironment()Return theEnvironmentassociated with this component.
-