1 25 26 package org.objectweb.jonas.webapp.jonasadmin.logging; 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.CatalinaObjectName; 39 import org.objectweb.jonas.jmx.JonasManagementRepr; 40 import org.objectweb.jonas.webapp.jonasadmin.common.ItemsForm; 41 42 45 public class ApplyLoggersConfirmAction extends BaseLoggerAction { 46 47 50 private String removeType[] = { 51 "java.lang.String", }; 53 54 56 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 57 , HttpServletRequest p_Request, HttpServletResponse p_Response) 58 throws IOException , ServletException { 59 60 ItemsForm oForm = (ItemsForm) p_Form; 62 63 try { 65 String [] values = new String [1]; 66 String operation = "removeValve"; 67 ObjectName onFactory = CatalinaObjectName.catalinaFactory(); 69 for (int i = 0; i < oForm.getSelectedItemsList().size(); i++) { 71 LoggerItem o = (LoggerItem) oForm.getSelectedItemsList().get(i); 72 values[0] = o.getObjectName(); 73 JonasManagementRepr.invoke(onFactory, operation, values, removeType); 74 } 75 refreshTree(p_Request); 77 } 78 catch (Throwable t) { 79 addGlobalError(t); 80 saveErrors(p_Request, m_Errors); 81 return (p_Mapping.findForward("Global Error")); 82 } 83 84 return p_Mapping.findForward("ActionListLoggers"); 86 } 87 } 88 | Popular Tags |