KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > webapp > jonasadmin > service > discovery > DiscoveryServiceStartMasterAction


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: DiscoveryServiceStartMasterAction.java,v 1.3 2005/07/25 21:03:55 pasmith Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.webapp.jonasadmin.service.discovery;
27
28 import java.io.IOException JavaDoc;
29
30 import javax.management.ObjectName JavaDoc;
31 import javax.servlet.ServletException JavaDoc;
32 import javax.servlet.http.HttpServletRequest JavaDoc;
33 import javax.servlet.http.HttpServletResponse JavaDoc;
34
35 import org.apache.struts.action.ActionForm;
36 import org.apache.struts.action.ActionForward;
37 import org.apache.struts.action.ActionMapping;
38 import org.objectweb.jonas.jmx.J2eeObjectName;
39 import org.objectweb.jonas.jmx.JonasManagementRepr;
40 import org.objectweb.jonas.jmx.JonasObjectName;
41 import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction;
42
43 /**
44  * @author Michel-Ange Anton
45  */

46
47 public class DiscoveryServiceStartMasterAction extends JonasBaseAction {
48
49 // --------------------------------------------------------- Public Methods
50

51     /**
52      * Process the specified HTTP request, and create the corresponding HTTP
53      * response (or forward to another web component that will create it).
54      * Return an <code>ActionForward</code> instance describing where and how
55      * control should be forwarded, or <code>null</code> if the response has
56      * already been completed.
57      *
58      * @param p_Mapping The ActionMapping used to select this instance
59      * @param p_Form The optional ActionForm bean for this request (if any)
60      * @param p_Request The HTTP request we are processing
61      * @param p_Response The HTTP response we are creating
62      *
63      * @return An <code>ActionForward</code> instance or <code>null</code>
64      *
65      * @exception IOException if an input/output error occurs
66      * @exception ServletException if a servlet exception occurs
67      */

68     public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form
69         , HttpServletRequest JavaDoc p_Request, HttpServletResponse JavaDoc p_Response)
70         throws IOException JavaDoc, ServletException JavaDoc {
71         // Object name used
72
ObjectName JavaDoc oObjectName = JonasObjectName.discoveryService();
73         try {
74             // call method
75
JonasManagementRepr.invoke(oObjectName, "startDiscoveryMaster", null, null);
76             // Refresh (add) the domain deployment nodes of the trees
77
refreshDomainDeployTree(p_Request);
78         }
79         catch (Throwable JavaDoc t) {
80             addGlobalError(t);
81             saveErrors(p_Request, m_Errors);
82             return (p_Mapping.findForward("Global Error"));
83         }
84
85         // Forward to the originating action to refresh form.
86
return (p_Mapping.findForward("ActionEditServiceDiscovery"));
87     }
88 }
89
Popular Tags