1 26 27 package org.objectweb.jonas.webapp.jonasadmin.logging; 28 29 import java.io.IOException ; 30 31 import javax.management.ObjectName ; 32 import javax.servlet.ServletException ; 33 import javax.servlet.http.HttpServletRequest ; 34 import javax.servlet.http.HttpServletResponse ; 35 36 import org.apache.struts.action.ActionForm; 37 import org.apache.struts.action.ActionForward; 38 import org.apache.struts.action.ActionMapping; 39 import org.objectweb.jonas.jmx.JonasManagementRepr; 40 import org.objectweb.jonas.jmx.JonasObjectName; 41 import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction; 42 43 46 47 public class ApplyLoggingJonasAction extends JonasBaseAction { 48 49 51 53 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 54 , HttpServletRequest p_Request, HttpServletResponse p_Response) 55 throws IOException , ServletException { 56 LoggingJonasForm oForm = (LoggingJonasForm) p_Form; 58 ObjectName oObjectName = null; 60 try { 61 oObjectName = JonasObjectName.logService("trace"); 62 String [] asSignature = new String [2]; 64 asSignature[0] = "java.lang.String"; 65 asSignature[1] = "java.lang.String"; 66 String [] asParam = new String [2]; 67 asParam[0] = oForm.getTopic(); 68 asParam[1] = oForm.getLevel(); 69 JonasManagementRepr.invoke(oObjectName, "setTopicLevel", asParam, asSignature); 70 } 71 catch (Throwable t) { 72 addGlobalError(t); 73 saveErrors(p_Request, m_Errors); 74 return (p_Mapping.findForward("Global Error")); 75 } 76 77 return (p_Mapping.findForward("ActionEditLoggingJonas")); 79 } 80 } 81 | Popular Tags |