KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > web > context > ConfigurableWebApplicationContext


1 /*
2  * Copyright 2002-2007 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
17 package org.springframework.web.context;
18
19 import javax.servlet.ServletConfig JavaDoc;
20 import javax.servlet.ServletContext JavaDoc;
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 WebApplicationContext, ConfigurableApplicationContext {
41
42     /**
43      * Any number of these characters are considered delimiters between
44      * multiple context config paths in a single String value.
45      * @see ContextLoader#CONFIG_LOCATION_PARAM
46      * @see org.springframework.web.servlet.FrameworkServlet#setContextConfigLocation
47      */

48     String JavaDoc CONFIG_LOCATION_DELIMITERS = ",; \t\n";
49
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 JavaDoc 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 JavaDoc servletConfig);
65
66     /**
67      * Return the ServletConfig for this web application context, if any.
68      */

69     ServletConfig JavaDoc 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 JavaDoc namespace);
77
78     /**
79      * Return the namespace for this web application context, if any.
80      */

81     String JavaDoc 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 JavaDoc[] configLocations);
89
90     /**
91      * Return the config locations for this web application context,
92      * or <code>null</code> if none specified.
93      */

94     String JavaDoc[] getConfigLocations();
95
96 }
97
Popular Tags