|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2012 the original author or authors. |
|
|
|
* Copyright 2002-2013 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -16,9 +16,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
package org.springframework.core.env; |
|
|
|
package org.springframework.core.env; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Interface indicating a component contains and makes available an {@link Environment} object. |
|
|
|
* Interface indicating a component that contains and exposes an {@link Environment} reference. |
|
|
|
* |
|
|
|
* |
|
|
|
* <p>All Spring application contexts are EnvironmentCapable, and the interface is used primarily |
|
|
|
* <p>All Spring application contexts are EnvironmentCapable, and the interface is used primarily |
|
|
|
* for performing {@code instanceof} checks in framework methods that accept BeanFactory |
|
|
|
* for performing {@code instanceof} checks in framework methods that accept BeanFactory |
|
|
|
@ -29,20 +28,20 @@ package org.springframework.core.env; |
|
|
|
* extends EnvironmentCapable, and thus exposes a {@link #getEnvironment()} method; however, |
|
|
|
* extends EnvironmentCapable, and thus exposes a {@link #getEnvironment()} method; however, |
|
|
|
* {@link org.springframework.context.ConfigurableApplicationContext ConfigurableApplicationContext} |
|
|
|
* {@link org.springframework.context.ConfigurableApplicationContext ConfigurableApplicationContext} |
|
|
|
* redefines {@link org.springframework.context.ConfigurableApplicationContext#getEnvironment |
|
|
|
* redefines {@link org.springframework.context.ConfigurableApplicationContext#getEnvironment |
|
|
|
* getEnvironment()} and narrows the signature to return a {@link ConfigurableEnvironment}. The effect |
|
|
|
* getEnvironment()} and narrows the signature to return a {@link ConfigurableEnvironment}. |
|
|
|
* is that an Environment object is 'read-only' until it accessed from a ConfigurableApplicationContext, |
|
|
|
* The effect is that an Environment object is 'read-only' until it is being accessed from |
|
|
|
* at which point it too may be configured. |
|
|
|
* a ConfigurableApplicationContext, at which point it too may be configured. |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Chris Beams |
|
|
|
* @author Chris Beams |
|
|
|
* @since 3.1 |
|
|
|
* @since 3.1 |
|
|
|
* @see Environment |
|
|
|
* @see Environment |
|
|
|
* @see ConfigurableEnvironment |
|
|
|
* @see ConfigurableEnvironment |
|
|
|
* @see org.springframework.context.ConfigurableApplicationContext#getEnvironment |
|
|
|
* @see org.springframework.context.ConfigurableApplicationContext#getEnvironment() |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public interface EnvironmentCapable { |
|
|
|
public interface EnvironmentCapable { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Return the Environment for this object |
|
|
|
* Return the {@link Environment} associated with this component. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
Environment getEnvironment(); |
|
|
|
Environment getEnvironment(); |
|
|
|
|
|
|
|
|
|
|
|
|