1 25 26 package org.objectweb.jonas.webapp.jonasadmin.service.resource; 27 28 import java.io.IOException ; 29 import java.util.List ; 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.webapp.jonasadmin.JonasBaseAction; 41 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 42 43 46 47 public class EditResourceAdapterASAction extends JonasBaseAction { 48 49 51 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 52 , HttpServletRequest p_Request, HttpServletResponse p_Response) 53 throws IOException , ServletException { 54 55 String sObjectName = p_Request.getParameter("select"); 57 58 ObjectName oObjectName = null; 59 String domainName = null; 60 String serverName = null; 61 62 ResourceAdapterASForm oForm = null; 64 if (sObjectName != null) { 66 try { 67 oObjectName = ObjectName.getInstance(sObjectName); 69 domainName = oObjectName.getDomain(); 70 serverName = oObjectName.getKeyProperty("J2EEServer"); 71 oForm = new ResourceAdapterASForm(); 73 oForm.reset(p_Mapping, p_Request); 74 if (oObjectName != null) { 75 oForm.setOName(oObjectName); 77 oForm.setName(getStringAttribute(oObjectName, "jndiName")); 78 oForm.setDescription(getStringAttribute(oObjectName, "description")); 79 oForm.setListProperties((List ) JonasManagementRepr.getAttribute(oObjectName 80 , "propertiesList")); 81 } 82 m_Session.setAttribute("resourceAdapterASForm", oForm); 83 } catch (Throwable t) { 84 addGlobalError(t); 85 saveErrors(p_Request, m_Errors); 86 return (p_Mapping.findForward("Global Error")); 87 } 88 } else { 89 oForm = (ResourceAdapterASForm) m_Session.getAttribute("resourceAdapterASForm"); 91 } 92 93 ResourceAdapterForm raForm = (ResourceAdapterForm) m_Session.getAttribute("resourceAdapterForm"); 94 95 m_WhereAreYou.selectNameNode(getTreeBranchName(DEPTH_SERVER) + WhereAreYou.NODE_SEPARATOR 97 + "services" + WhereAreYou.NODE_SEPARATOR + "resourceAdapter" 98 + WhereAreYou.NODE_SEPARATOR + raForm.getFile(), true); 99 100 return (p_Mapping.findForward("Resource AdapterAS")); 102 } 103 } 104 | Popular Tags |