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; 41 import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction; 42 43 47 public class ResetCountersAction extends JonasBaseAction { 48 58 public ActionForward executeAction(ActionMapping pMapping, ActionForm pForm 59 , HttpServletRequest pRequest, HttpServletResponse pResponse) 60 throws IOException , ServletException { 61 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 JonasManagementRepr.invoke(jtaResourceObjectName, "resetAllCounters", null, null); 69 } catch (Throwable t) { 70 addGlobalError(t); 71 saveErrors(pRequest, m_Errors); 72 return (pMapping.findForward("Global Error")); 73 } 74 75 return (pMapping.findForward("ActionEditTransactionStatistic")); 77 } 78 79 } 80 | Popular Tags |