KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Copyright 2002-2006 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.ServletContext JavaDoc;
20
21 import org.springframework.context.ApplicationContext;
22
23 /**
24  * Interface to provide configuration for a web application. This is read-only while
25  * the application is running, but may be reloaded if the implementation supports this.
26  *
27  * <p>This interface adds a getServletContext method to the generic ApplicationContext
28  * interface, and defines a well-known application attribute name that the root
29  * context must be bound to in the bootstrap process.
30  *
31  * <p>Like generic application contexts, web application contexts are hierarchical.
32  * There is a single root context per application, while each servlet in the application
33  * (including a dispatcher servlet in the MVC framework) has its own child context.
34  *
35  * <p>In addition to standard application context lifecycle capabilities,
36  * WebApplicationContext implementations need to detect ServletContextAware
37  * beans and invoke the setServletContext method accordingly.
38  *
39  * @author Rod Johnson
40  * @author Juergen Hoeller
41  * @since January 19, 2001
42  * @see ServletContextAware#setServletContext
43  */

44 public interface WebApplicationContext extends ApplicationContext {
45
46     /**
47      * Context attribute to bind root WebApplicationContext to on successful startup.
48      * <p>Note: If the startup of the root context fails, this attribute can contain
49      * an exception or error as value. Use WebApplicationContextUtils for convenient
50      * lookup of the root WebApplicationContext.
51      * @see org.springframework.web.context.support.WebApplicationContextUtils#getWebApplicationContext
52      * @see org.springframework.web.context.support.WebApplicationContextUtils#getRequiredWebApplicationContext
53      */

54     String JavaDoc ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE = WebApplicationContext.class.getName() + ".ROOT";
55
56
57     /**
58      * Scope identifier for request scope: "request".
59      * Supported in addition to the standard scopes "singleton" and "prototype".
60      */

61     String JavaDoc SCOPE_REQUEST = "request";
62
63     /**
64      * Scope identifier for session scope: "session".
65      * Supported in addition to the standard scopes "singleton" and "prototype".
66      */

67     String JavaDoc SCOPE_SESSION = "session";
68
69     /**
70      * Scope identifier for global session scope: "globalSession".
71      * Supported in addition to the standard scopes "singleton" and "prototype".
72      */

73     String JavaDoc SCOPE_GLOBAL_SESSION = "globalSession";
74
75
76     /**
77      * Return the standard Servlet API ServletContext for this application.
78      */

79     ServletContext JavaDoc getServletContext();
80     
81 }
82
Popular Tags