|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2010 the original author or authors. |
| 2 | + * Copyright 2002-2012 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -230,22 +230,31 @@ public static void registerEnvironmentBeans(
|
230 | 230 | }
|
231 | 231 |
|
232 | 232 | /**
|
233 |
| - * Replace {@code Servlet}-based stub property sources with actual instances |
234 |
| - * populated with the given context object. |
235 |
| - * @see org.springframework.core.env.PropertySource.StubPropertySource |
236 |
| - * @see org.springframework.core.env.ConfigurableEnvironment#getPropertySources() |
237 |
| - * @see org.springframework.web.context.support.WebApplicationContextUtils#initServletPropertySources(MutablePropertySources, ServletContext) |
| 233 | + * Convenient variant of {@link #initServletPropertySources(MutablePropertySources, |
| 234 | + * ServletContext, ServletConfig)} that always provides {@code null} for the |
| 235 | + * {@link ServletConfig} parameter. |
| 236 | + * @see #initServletPropertySources(MutablePropertySources, ServletContext, ServletConfig) |
238 | 237 | */
|
239 | 238 | public static void initServletPropertySources(
|
240 | 239 | MutablePropertySources propertySources, ServletContext servletContext) {
|
241 | 240 | initServletPropertySources(propertySources, servletContext, null);
|
242 | 241 | }
|
243 | 242 |
|
244 | 243 | /**
|
245 |
| - * Replace {@code Servlet}-based stub property sources with actual instances |
246 |
| - * populated with the given context and config objects. |
| 244 | + * Replace {@code Servlet}-based {@link StubPropertySource stub property sources} with |
| 245 | + * actual instances populated with the given {@code servletContext} and |
| 246 | + * {@code servletConfig} objects. |
| 247 | + * <p>This method is idempotent with respect to the fact it may be called any number |
| 248 | + * of times but will perform replacement of stub property sources with their |
| 249 | + * corresponding actual property sources once and only once. |
| 250 | + * @param propertySources the {@link PropertySources} to initialize (must not be {@code null}) |
| 251 | + * @param servletContext the current {@link ServletContext} (ignored if {@code null} |
| 252 | + * or if the {@link StandardServletEnvironment#SERVLET_CONTEXT_PROPERTY_SOURCE_NAME |
| 253 | + * servlet context property source} has already been initialized) |
| 254 | + * @param servletConfig the current {@link ServletConfig} (ignored if {@code null} |
| 255 | + * or if the {@link StandardServletEnvironment#SERVLET_CONFIG_PROPERTY_SOURCE_NAME |
| 256 | + * servlet config property source} has already been initialized) |
247 | 257 | * @see org.springframework.core.env.PropertySource.StubPropertySource
|
248 |
| - * @see org.springframework.web.context.support.WebApplicationContextUtils#initServletPropertySources(MutablePropertySources, ServletContext) |
249 | 258 | * @see org.springframework.core.env.ConfigurableEnvironment#getPropertySources()
|
250 | 259 | */
|
251 | 260 | public static void initServletPropertySources(
|
|
0 commit comments