1 25 26 package org.objectweb.jonas.webapp.jonasadmin.monitoring; 27 28 import java.io.IOException ; 29 30 import javax.management.ObjectName ; 31 import javax.servlet.ServletException ; 32 import javax.servlet.http.HttpServletRequest ; 33 import javax.servlet.http.HttpServletResponse ; 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.webapp.jonasadmin.JonasBaseAction; 41 42 45 46 public class EditMonitoringAction extends JonasBaseAction { 47 48 50 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form, HttpServletRequest p_Request, 51 HttpServletResponse p_Response) throws IOException , ServletException { 52 MonitoringForm oForm = (MonitoringForm) p_Form; 54 ObjectName oObjectName = null; 56 ObjectName o2 = null; 57 try { 58 oObjectName = J2eeObjectName.J2EEServer(m_WhereAreYou.getCurrentDomainName(), m_WhereAreYou 59 .getCurrentJonasServerName()); 60 oForm.setActivated(getBooleanAttribute(oObjectName, "activated")); 61 o2 = ObjectName.getInstance(((String []) JonasManagementRepr.getAttribute(oObjectName , "javaVMs"))[0]); 62 oForm.setAllThreadsCount(getIntegerAttribute(o2, "allThreadsCount")); 63 } catch (Throwable t) { 64 addGlobalError(t); 65 saveErrors(p_Request, m_Errors); 66 return (p_Mapping.findForward("Global Error")); 67 } 68 return (p_Mapping.findForward("Monitoring")); 70 } 71 } | Popular Tags |