1 25 26 package org.objectweb.jonas.webapp.jonasadmin.service.jtm; 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.J2eeObjectName; 40 import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction; 41 42 45 public class ApplyJtmConfigurationAction extends JonasBaseAction { 46 56 public ActionForward executeAction(ActionMapping pMapping, ActionForm pForm 57 , HttpServletRequest pRequest, HttpServletResponse pResponse) 58 throws IOException , ServletException { 59 60 JtmServiceForm oForm = (JtmServiceForm) pForm; 62 try { 63 String currentDomainName = m_WhereAreYou.getCurrentDomainName(); 65 String currentJonasServerName = m_WhereAreYou.getCurrentJonasServerName(); 66 String jtaResourceName = "JTAResource"; 67 ObjectName jtaResourceObjectName = J2eeObjectName.JTAResource(currentDomainName, currentJonasServerName, jtaResourceName); 68 69 JonasManagementRepr.setAttribute(jtaResourceObjectName, "timeOut", new Integer (oForm.getTimeOutText())); 70 71 if (oForm.getAction().equals("save")) { 72 JonasManagementRepr.invoke(jtaResourceObjectName, "saveConfig", null, null); 73 } 74 } catch (Throwable t) { 75 addGlobalError(t); 76 saveErrors(pRequest, m_Errors); 77 return (pMapping.findForward("Global Error")); 78 } 79 80 return (pMapping.findForward("Jtm Service")); 82 } 83 84 } 85 | Popular Tags |