1 25 26 package org.objectweb.jonas.webapp.jonasadmin.resource; 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.JonasManagementRepr; 39 import org.objectweb.jonas.jmx.JonasObjectName; 40 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 41 import org.objectweb.jonas.webapp.jonasadmin.deploy.BaseDeployAction; 42 43 44 48 49 public class ApplyDestinationAction extends BaseDeployAction { 50 51 53 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 54 , HttpServletRequest p_Request, HttpServletResponse p_Response) 55 throws IOException , ServletException { 56 57 DestinationForm oForm = (DestinationForm) p_Form; 59 60 try { 61 String name = oForm.getName(); 62 ObjectName oObjectName = JonasObjectName.jmsService(); 65 String [] asParam = { 66 oForm.getName() 67 }; 68 String [] asSignature = { 69 "java.lang.String" 70 }; 71 String type = oForm.getType(); 72 if (type.equals(m_Resources.getMessage("label.resource.destinations.queue"))) 73 JonasManagementRepr.invoke(oObjectName, "createJmsQueueDestination", asParam, asSignature); 74 else if (type.equals(m_Resources.getMessage("label.resource.destinations.topic"))) 75 JonasManagementRepr.invoke(oObjectName, "createJmsTopicDestination", asParam, asSignature); 76 77 refreshServiceTree(WhereAreYou.DEPLOYMENT_JMS, p_Request); 79 80 oForm.reset(p_Mapping, p_Request); 81 82 } catch (Throwable t) { 83 addGlobalError(t); 84 saveErrors(p_Request, m_Errors); 85 return (p_Mapping.findForward("Global Error")); 86 } 87 88 return (p_Mapping.findForward("Create Destination")); 90 } 91 } 92 | Popular Tags |