1 25 26 package org.objectweb.jonas.webapp.jonasadmin.service.container; 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.CatalinaObjectName; 40 import org.objectweb.jonas.jmx.JonasManagementRepr; 41 42 45 public class ApplyWebsConfirmAction extends BaseWebAppAction { 46 47 50 private String removeContextTypes[] = { 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("listWebContainersSelected"); 62 63 try { 65 String [] values = new String [1]; 66 String operation = "removeContext"; 67 ObjectName onFactory = CatalinaObjectName.catalinaFactory(); 69 for (int i = 0; i < alSelected.size(); i++) { 71 WebAppItem o = (WebAppItem) alSelected.get(i); 72 values[0] = o.getObjectName(); 73 JonasManagementRepr.invoke(onFactory, operation, values, removeContextTypes); 74 } 75 refreshTree(p_Request); 77 79 80 } 81 catch (Throwable t) { 82 addGlobalError(t); 83 saveErrors(p_Request, m_Errors); 84 return (p_Mapping.findForward("Global Error")); 85 } 86 87 return p_Mapping.findForward("ActionListWebContainers"); 89 } 90 } 91 | Popular Tags |