1 25 26 package org.objectweb.jonas.webapp.jonasadmin.catalina; 27 28 import java.io.IOException ; 29 import java.util.ArrayList ; 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.CatalinaObjectName; 41 42 45 public class ApplyConnectorsConfirmAction extends CatalinaBaseAction { 46 47 50 private String removeConnectorTypes[] = { 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 ArrayList alSelected = (ArrayList ) m_Session.getAttribute("listConnectorsSelected"); 62 63 try { 65 String [] values = new String [1]; 66 String operation = "removeConnector"; 67 ObjectName onFactory = CatalinaObjectName.catalinaFactory(); 69 for (int i = 0; i < alSelected.size(); i++) { 71 ConnectorItem o = (ConnectorItem) alSelected.get(i); 72 values[0] = o.getObjectName(); 73 JonasManagementRepr.invoke(onFactory, operation, values, removeConnectorTypes); 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("ActionListCatalinaConnectors"); 86 } 87 } 88 | Popular Tags |