01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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:
17: package org.springframework.web.context;
18:
19: import javax.servlet.ServletConfig;
20: import javax.servlet.ServletContext;
21:
22: import org.springframework.context.ConfigurableApplicationContext;
23:
24: /**
25: * Interface to be implemented by configurable web application contexts.
26: * Supported by {@link ContextLoader} and
27: * {@link org.springframework.web.servlet.FrameworkServlet}.
28: *
29: * <p>Note: The setters of this interface need to be called before an
30: * invocation of the {@link #refresh} method inherited from
31: * {@link org.springframework.context.ConfigurableApplicationContext}.
32: * They do not cause an initialization of the context on their own.
33: *
34: * @author Juergen Hoeller
35: * @since 05.12.2003
36: * @see #refresh
37: * @see ContextLoader#createWebApplicationContext
38: * @see org.springframework.web.servlet.FrameworkServlet#createWebApplicationContext
39: */
40: public interface ConfigurableWebApplicationContext extends
41: WebApplicationContext, ConfigurableApplicationContext {
42:
43: /**
44: * Any number of these characters are considered delimiters between
45: * multiple context config paths in a single String value.
46: * @see ContextLoader#CONFIG_LOCATION_PARAM
47: * @see org.springframework.web.servlet.FrameworkServlet#setContextConfigLocation
48: */
49: String CONFIG_LOCATION_DELIMITERS = ",; \t\n";
50:
51: /**
52: * Set the ServletContext for this web application context.
53: * <p>Does not cause an initialization of the context: refresh needs to be
54: * called after the setting of all configuration properties.
55: * @see #refresh()
56: */
57: void setServletContext(ServletContext servletContext);
58:
59: /**
60: * Set the ServletConfig for this web application context.
61: * Only called for a WebApplicationContext that belongs to a specific Servlet.
62: * @see #refresh()
63: */
64: void setServletConfig(ServletConfig servletConfig);
65:
66: /**
67: * Return the ServletConfig for this web application context, if any.
68: */
69: ServletConfig getServletConfig();
70:
71: /**
72: * Set the namespace for this web application context,
73: * to be used for building a default context config location.
74: * The root web application context does not have a namespace.
75: */
76: void setNamespace(String namespace);
77:
78: /**
79: * Return the namespace for this web application context, if any.
80: */
81: String getNamespace();
82:
83: /**
84: * Set the config locations for this web application context.
85: * <p>If not set, the implementation is supposed to use a default for the
86: * given namespace or the root web application context, as appropriate.
87: */
88: void setConfigLocations(String[] configLocations);
89:
90: /**
91: * Return the config locations for this web application context,
92: * or <code>null</code> if none specified.
93: */
94: String[] getConfigLocations();
95:
96: }
|