KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > module > admininterface > pages > RestartPage


1 /**
2  *
3  * Magnolia and its source-code is licensed under the LGPL.
4  * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5  * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6  * you are required to provide proper attribution to obinary.
7  * If you reproduce or distribute the document without making any substantive modifications to its content,
8  * please use the following attribution line:
9  *
10  * Copyright 1993-2006 obinary Ltd. (http://www.obinary.com) All rights reserved.
11  *
12  */

13 package info.magnolia.module.admininterface.pages;
14
15 import info.magnolia.cms.beans.config.ModuleLoader;
16 import info.magnolia.cms.i18n.Messages;
17 import info.magnolia.cms.i18n.MessagesManager;
18 import info.magnolia.cms.module.Module;
19 import info.magnolia.module.admininterface.TemplatedMVCHandler;
20
21 import java.util.ArrayList JavaDoc;
22 import java.util.Iterator JavaDoc;
23 import java.util.List JavaDoc;
24
25 import javax.servlet.http.HttpServletRequest JavaDoc;
26 import javax.servlet.http.HttpServletResponse JavaDoc;
27
28
29 /**
30  * @author Fabrizio Giustina
31  * @version $Revision: 6341 $ ($Author: philipp $)
32  */

33 public class RestartPage extends TemplatedMVCHandler {
34
35     /**
36      * Required constructor.
37      * @param name page name
38      * @param request HttpServletRequest
39      * @param response HttpServletResponse
40      */

41     public RestartPage(String JavaDoc name, HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
42         super(name, request, response);
43     }
44
45     public List JavaDoc getRestartNeedingModules() {
46         // is a system restart needed
47
List JavaDoc restartNeedingModules = new ArrayList JavaDoc();
48
49         // collect the modules needing a restart
50
for (Iterator JavaDoc iter = ModuleLoader.getInstance().getModuleInstances().keySet().iterator(); iter.hasNext();) {
51             String JavaDoc moduleName = (String JavaDoc) iter.next();
52             Module module = ModuleLoader.getInstance().getModuleInstance(moduleName);
53             if (module.isRestartNeeded()) {
54                 restartNeedingModules.add(module);
55             }
56         }
57
58         return restartNeedingModules;
59     }
60
61     public Messages getMessages() {
62         return MessagesManager.getMessages();
63     }
64
65 }
66
Popular Tags