1 25 26 package org.objectweb.jonas.webapp.jonasadmin.joramplatform; 27 28 import javax.management.ObjectName ; 29 import javax.servlet.http.HttpServletRequest ; 30 import javax.servlet.http.HttpServletResponse ; 31 32 import org.apache.struts.action.ActionForm; 33 import org.apache.struts.action.ActionForward; 34 import org.apache.struts.action.ActionMapping; 35 import org.objectweb.jonas.jmx.JonasManagementRepr; 36 import org.objectweb.jonas.jmx.JonasObjectName; 37 import org.objectweb.jonas.jmx.JoramObjectName; 38 import org.objectweb.jonas.webapp.jonasadmin.deploy.BaseDeployAction; 39 40 43 public class RemoveConfirmUsersAction extends BaseDeployAction { 44 45 public ActionForward executeAction(ActionMapping pMapping, ActionForm pForm 46 , HttpServletRequest pRequest, HttpServletResponse pResponse) { 47 48 RemoveUsersForm oForm = (RemoveUsersForm) m_Session.getAttribute("removeUsersForm"); 50 String localId = (String ) m_Session.getAttribute("localId"); String currentId = (String ) m_Session.getAttribute("currentId"); try { 53 String destinationName = null; 54 ObjectName joramAdapterON = (ObjectName ) JonasManagementRepr.queryNames(JoramObjectName.joramAdapter()).iterator().next(); 55 ObjectName destinationObjectName = null; 56 for (int i = 0; i < oForm.getSelectedItems().length; i++) { 57 destinationName = oForm.getSelectedItems()[i]; 58 if (currentId.equals(localId)) { 59 String [] asParam = { 60 destinationName 61 }; 62 String [] asSignature = { 63 "java.lang.String" 64 }; 65 JonasManagementRepr.invoke(joramAdapterON, "removeDestination", asParam, asSignature); 66 } else { 67 destinationObjectName = JoramObjectName.joramQueue(destinationName); 68 if (JonasManagementRepr.isRegistered(destinationObjectName)) { 69 JonasManagementRepr.invoke(destinationObjectName, "delete", null, null); 71 } else { 72 destinationObjectName = JoramObjectName.joramTopic(destinationName); 73 if (JonasManagementRepr.isRegistered(destinationObjectName)) { 74 JonasManagementRepr.invoke(destinationObjectName, "delete", null, null); 76 } 77 } 78 } 79 } 80 refreshJoramTree(pRequest); 82 83 } catch (Throwable t) { 84 addGlobalError(t); 85 saveErrors(pRequest, m_Errors); 86 return (pMapping.findForward("Global Error")); 87 } 88 89 return (pMapping.findForward("ActionEditJoramServer")); 91 } 92 } 93 | Popular Tags |