1. /*
  2. * Copyright 2002-2004 the original author or authors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.springframework.web.context;
  17. import javax.servlet.ServletContext;
  18. import org.springframework.context.ConfigurableApplicationContext;
  19. /**
  20. * Interface to be implemented by configurable web application contexts.
  21. * Expected by ContextLoader and FrameworkServlet.
  22. *
  23. * <p>Note: The setters of this interface need to be called before an invocation
  24. * of the refresh method inherited from ConfigurableApplicationContext.
  25. * They do not cause an initialization of the context on their own.
  26. *
  27. * @author Juergen Hoeller
  28. * @since 05.12.2003
  29. * @see #refresh
  30. * @see ContextLoader#createWebApplicationContext
  31. * @see org.springframework.web.servlet.FrameworkServlet#createWebApplicationContext
  32. */
  33. public interface ConfigurableWebApplicationContext extends WebApplicationContext, ConfigurableApplicationContext {
  34. /**
  35. * Any number of these characters are considered delimiters
  36. * between multiple context paths in a single-String config location.
  37. * @see ContextLoader#CONFIG_LOCATION_PARAM
  38. * @see org.springframework.web.servlet.FrameworkServlet#setContextConfigLocation
  39. */
  40. String CONFIG_LOCATION_DELIMITERS = ",; ";
  41. /**
  42. * Set the ServletContext for this web application context.
  43. * <p>Does not cause an initialization of the context: refresh needs to be
  44. * called after the setting of all configuration properties.
  45. * @see #refresh
  46. */
  47. void setServletContext(ServletContext servletContext);
  48. /**
  49. * Set the namespace for this web application context,
  50. * to be used for building a default context config location.
  51. * The root web application context does not have a namespace.
  52. */
  53. void setNamespace(String namespace);
  54. /**
  55. * Set the config locations for this web application context.
  56. * If not set, the implementation is supposed to use a default for the
  57. * given namespace respectively the root web application context.
  58. */
  59. void setConfigLocations(String[] configLocations);
  60. }