KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ivata > groupware > container > struts > ResetContainerAction


1 /*
2  * Copyright (c) 2001 - 2005 ivata limited.
3  * All rights reserved.
4  * ---------------------------------------------------------
5  * ivata groupware may be redistributed under the GNU General Public
6  * License as published by the Free Software Foundation;
7  * version 2 of the License.
8  *
9  * These programs are free software; you can redistribute them and/or
10  * modify them under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; version 2 of the License.
12  *
13  * These programs are distributed in the hope that they will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  * See the GNU General Public License in the file LICENSE.txt for more
18  * details.
19  *
20  * If you would like a copy of the GNU General Public License write to
21  *
22  * Free Software Foundation, Inc.
23  * 59 Temple Place - Suite 330
24  * Boston, MA 02111-1307, USA.
25  *
26  *
27  * To arrange commercial support and licensing, contact ivata at
28  * http://www.ivata.com/contact.jsp
29  * ---------------------------------------------------------
30  * $Log: ResetContainerAction.java,v $
31  * Revision 1.1 2005/04/11 10:54:43 colinmacleod
32  * Added simple struts action to reset the
33  * pico container factory.
34  *
35  * ---------------------------------------------------------
36  */

37 package com.ivata.groupware.container.struts;
38
39 import javax.servlet.http.HttpServletRequest JavaDoc;
40 import javax.servlet.http.HttpServletResponse JavaDoc;
41 import javax.servlet.http.HttpSession JavaDoc;
42
43 import org.apache.struts.action.ActionErrors;
44 import org.apache.struts.action.ActionForm;
45 import org.apache.struts.action.ActionMapping;
46
47 import com.ivata.groupware.container.PicoContainerFactory;
48 import com.ivata.mask.MaskFactory;
49 import com.ivata.mask.util.SystemException;
50 import com.ivata.mask.web.struts.MaskAction;
51 import com.ivata.mask.web.struts.MaskAuthenticator;
52
53 /**
54  * Call this action to reset the main container and reload the configuration.
55  *
56  * @since ivata groupware 0.11 (2005-03-31)
57  * @author Colin MacLeod
58  * <a HREF='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
59  * @version $Revision: 1.1 $
60  */

61
62 public class ResetContainerAction extends MaskAction {
63     public ResetContainerAction(MaskFactory maskFactoryParam,
64             MaskAuthenticator authenticatorParam) {
65         super(maskFactoryParam, authenticatorParam);
66     }
67
68     /**
69      * This method simply calls {@link PicoContainerFactory#reset
70      * PicoContainerFactory.reset()}.
71      *
72      * @param mappingParam
73      * Refer to {@link MaskAction#execute}.
74      * @param errorsParam
75      * Refer to {@link MaskAction#execute}.
76      * @param formParam
77      * Refer to {@link MaskAction#execute}.
78      * @param requestParam
79      * Refer to {@link MaskAction#execute}.
80      * @param responseParam
81      * Refer to {@link MaskAction#execute}.
82      * @param sessionParam
83      * Refer to {@link MaskAction#execute}.
84      * @return
85      * Refer to {@link MaskAction#execute}.
86      * @throws SystemException
87      * Refer to {@link MaskAction#execute}.
88      */

89     public String JavaDoc execute(ActionMapping mappingParam, ActionErrors errorsParam,
90             ActionForm formParam, HttpServletRequest JavaDoc requestParam,
91             HttpServletResponse JavaDoc responseParam, HttpSession JavaDoc sessionParam)
92             throws SystemException {
93         // just reset the container!
94
PicoContainerFactory.getInstance().initialize();
95         return "success";
96     }
97 }
98
Popular Tags