1 25 26 package org.objectweb.jonas.webapp.jonasadmin.service.jms; 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.JonasObjectName; 39 import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction; 40 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 41 42 47 public class EditJmsServiceAction extends JonasBaseAction { 48 49 public static final String JORAM = "org.objectweb.jonas_jms.JmsAdminForJoram"; 50 51 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 52 , HttpServletRequest p_Request, HttpServletResponse p_Response) 53 throws IOException , ServletException { 54 55 m_WhereAreYou.selectNameNode(getTreeBranchName(DEPTH_SERVER) + WhereAreYou.NODE_SEPARATOR 57 + "services" + WhereAreYou.NODE_SEPARATOR + "jms", true); 58 59 JmsServiceForm oForm = (JmsServiceForm) p_Form; 61 try { 62 ObjectName oObjectName = JonasObjectName.jmsService(); 64 String momName = (String ) getStringAttribute(oObjectName, "Mom"); 65 if (momName.equals(JORAM)) { 66 momName = m_Resources.getMessage("tab.mom.joram"); 67 } 68 oForm.setMomName(momName); 69 70 String location; 71 if (getBooleanAttribute(oObjectName, "MomLocal")) { 72 location = m_Resources.getMessage("tab.mom.collocated"); 74 oForm.setMomLocation(location); 75 } 76 else { 77 location = m_Resources.getMessage("tab.mom.distant"); 79 oForm.setMomLocation(location); 80 } 81 82 String momUrl = (String ) getStringAttribute(oObjectName, "Url"); 83 oForm.setMomUrl(momUrl); 84 } 85 catch (Throwable t) { 86 addGlobalError(t); 87 saveErrors(p_Request, m_Errors); 88 return (p_Mapping.findForward("Global Error")); 89 } 90 91 return (p_Mapping.findForward("Jms Service")); 93 } 94 } 95 | Popular Tags |