KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > config > servlet > ConfigServlet


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.config.servlet;
8
9
10 import java.io.IOException JavaDoc;
11
12 import javax.servlet.ServletException JavaDoc;
13 import javax.servlet.http.HttpServlet JavaDoc;
14 import javax.servlet.http.HttpServletRequest JavaDoc;
15 import javax.servlet.http.HttpServletResponse JavaDoc;
16
17 import com.inversoft.verge.config.VergeConfigMonitor;
18
19
20 /**
21  * <p>
22  * This class is a servlet that initializes all the
23  * configuration for a Portal application, but also allows
24  * for configuration reloading via the doGet and doPost
25  * methods.
26  * </p>
27  *
28  * @author Brian Pontarelli
29  * @since 2.0
30  * @version 2.0
31  */

32 public class ConfigServlet extends HttpServlet JavaDoc {
33
34     /**
35      * Constructor for ConfigServlet.
36      */

37     public ConfigServlet() {
38         super();
39     }
40
41
42     /**
43      * Calls refresh on the {@link VergeConfigMonitor VergeConfigMonitor} class.
44      *
45      * @see javax.servlet.GenericServlet#init()
46      */

47     public void init() {
48         // Load the configuration
49
VergeConfigMonitor.refresh(getServletContext());
50     }
51
52     /**
53      * Calls doPost()
54      */

55     public void doGet(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response)
56     throws ServletException JavaDoc, IOException JavaDoc {
57         doPost(request, response);
58     }
59
60     /**
61      * Calls the {@link VergeConfigMonitor VergeConfigMonitor} to reload the
62      * configuration.
63      */

64     public void doPost(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response)
65     throws ServletException JavaDoc, IOException JavaDoc {
66         VergeConfigMonitor.refresh(getServletContext());
67     }
68 }
Popular Tags