1 25 26 package org.objectweb.jonas.webapp.jonasadmin.service.mail; 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 46 public class EditMailServiceAction extends JonasBaseAction { 47 48 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 49 , HttpServletRequest p_Request, HttpServletResponse p_Response) 50 throws IOException , ServletException { 51 52 MailServiceForm oForm = (MailServiceForm) p_Form; 54 55 m_WhereAreYou.selectNameNode(getTreeBranchName(DEPTH_SERVER) + WhereAreYou.NODE_SEPARATOR 57 + "services" + WhereAreYou.NODE_SEPARATOR + "mail", true); 58 59 try { 60 ObjectName oObjectName = JonasObjectName.mailService(); 62 int factories = getIntegerAttribute(oObjectName, "CurrentNumberOfSessionMailFactories"); 63 int totalNumber = factories; 64 oForm.setNbSessionFactories(factories); 65 factories = getIntegerAttribute(oObjectName, "CurrentNumberOfMimeMailFactories"); 66 oForm.setNbMimePartDatasourceFactories(factories); 67 totalNumber += factories; 68 oForm.setNbFactories(totalNumber); 69 } 70 catch (Throwable t) { 71 addGlobalError(t); 72 saveErrors(p_Request, m_Errors); 73 return (p_Mapping.findForward("Global Error")); 74 } 75 76 return (p_Mapping.findForward("Mail Service")); 78 } 79 } 80 | Popular Tags |