001/*
002 * Copyright 2002-2012 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.web.context;
018
019import javax.servlet.ServletConfig;
020import javax.servlet.ServletContext;
021
022import org.springframework.core.env.ConfigurableEnvironment;
023
024/**
025 * Specialization of {@link ConfigurableEnvironment} allowing initialization of
026 * servlet-related {@link org.springframework.core.env.PropertySource} objects at the
027 * earliest moment that the {@link ServletContext} and (optionally) {@link ServletConfig}
028 * become available.
029 *
030 * @author Chris Beams
031 * @since 3.1.2
032 * @see ConfigurableWebApplicationContext#getEnvironment()
033 */
034public interface ConfigurableWebEnvironment extends ConfigurableEnvironment {
035
036        /**
037         * Replace any {@linkplain
038         * org.springframework.core.env.PropertySource.StubPropertySource stub property source}
039         * instances acting as placeholders with real servlet context/config property sources
040         * using the given parameters.
041         * @param servletContext the {@link ServletContext} (may not be {@code null})
042         * @param servletConfig the {@link ServletConfig} ({@code null} if not available)
043         * @see org.springframework.web.context.support.WebApplicationContextUtils#initServletPropertySources(
044         * org.springframework.core.env.MutablePropertySources, ServletContext, ServletConfig)
045         */
046        void initPropertySources(ServletContext servletContext, ServletConfig servletConfig);
047
048}