EditJmxServerAction.java

00001 
00026 package org.objectweb.jonas.webapp.jonasadmin.jonasserver;
00027 
00028 import java.io.IOException;
00029 
00030 import javax.management.ObjectName;
00031 import javax.servlet.ServletException;
00032 import javax.servlet.http.HttpServletRequest;
00033 import javax.servlet.http.HttpServletResponse;
00034 
00035 import org.apache.struts.action.ActionForm;
00036 import org.apache.struts.action.ActionForward;
00037 import org.apache.struts.action.ActionMapping;
00038 import org.objectweb.jonas.jmx.JonasObjectName;
00039 import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction;
00040 
00045 public class EditJmxServerAction extends JonasBaseAction {
00046 
00047 // --------------------------------------------------------- Public Methods
00048 
00049     public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form
00050         , HttpServletRequest p_Request, HttpServletResponse p_Response)
00051         throws IOException, ServletException {
00052         // Force the node selected in tree
00053         m_WhereAreYou.selectNameNode(getTreeBranchName(DEPTH_SERVER), true);
00054         // Form used
00055         JmxServerForm oForm = (JmxServerForm) p_Form;
00056         try {
00057             // Object name used
00058             ObjectName oObjectName = JonasObjectName.jmxService();
00059             // Copy scalar properties
00060             oForm.setMBeanServerId(getStringAttribute(oObjectName, "MBeanServerId"));
00061             oForm.setSpecificationName(getStringAttribute(oObjectName, "SpecificationName"));
00062             oForm.setSpecificationVersion(getStringAttribute(oObjectName, "SpecificationVersion"));
00063             oForm.setSpecificationVendor(getStringAttribute(oObjectName, "SpecificationVendor"));
00064             oForm.setImplementationName(getStringAttribute(oObjectName, "ImplementationName"));
00065             oForm.setImplementationVersion(getStringAttribute(oObjectName, "ImplementationVersion"));
00066             oForm.setImplementationVendor(getStringAttribute(oObjectName, "ImplementationVendor"));
00067         }
00068         catch (Throwable t) {
00069             addGlobalError(t);
00070             saveErrors(p_Request, m_Errors);
00071             return (p_Mapping.findForward("Global Error"));
00072         }
00073 
00074         // Forward to the jsp.
00075         return (p_Mapping.findForward("JmxServer"));
00076     }
00077 
00078 }

Generated on Tue Feb 15 15:05:26 2005 for JOnAS by  doxygen 1.3.9.1