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.J2eeObjectName; 39 import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction; 40 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 41 42 46 public class EditTransactionStatisticAction extends JonasBaseAction { 47 57 public ActionForward executeAction(ActionMapping pMapping, ActionForm pForm 58 , HttpServletRequest pRequest, HttpServletResponse pResponse) 59 throws IOException , ServletException { 60 61 m_WhereAreYou.selectNameNode(getTreeBranchName(DEPTH_SERVER) + WhereAreYou.NODE_SEPARATOR 63 + "services" + WhereAreYou.NODE_SEPARATOR + "transaction", true); 64 65 JtmServiceStatisticForm oForm = (JtmServiceStatisticForm) pForm; 67 try { 68 String currentDomainName = m_WhereAreYou.getCurrentDomainName(); 70 String currentJonasServerName = m_WhereAreYou.getCurrentJonasServerName(); 71 String jtaResourceName = "JTAResource"; 72 ObjectName jtaResourceObjectName = J2eeObjectName.JTAResource(currentDomainName, currentJonasServerName, jtaResourceName); 73 oForm.setCurrentTransactions(getIntegerAttribute(jtaResourceObjectName, "totalCurrentTransactions")); 74 oForm.setBegunTransactions(getIntegerAttribute(jtaResourceObjectName, "totalBegunTransactions")); 75 oForm.setCommitedTransactions(getIntegerAttribute(jtaResourceObjectName, "totalCommittedTransactions")); 76 oForm.setRollBackedTransactions(getIntegerAttribute(jtaResourceObjectName, "totalRolledbackTransactions")); 77 oForm.setExpiredTransactions(getIntegerAttribute(jtaResourceObjectName, "totalExpiredTransactions")); 78 } catch (Throwable t) { 79 addGlobalError(t); 80 saveErrors(pRequest, m_Errors); 81 return (pMapping.findForward("Global Error")); 82 } 83 84 return (pMapping.findForward("Transaction Statistic")); 86 } 87 88 } 89 | Popular Tags |