1 25 26 package org.objectweb.jonas.webapp.jonasadmin.resource; 27 28 import java.util.Properties ; 29 30 import javax.servlet.ServletException ; 31 import javax.servlet.http.HttpServletRequest ; 32 import javax.servlet.http.HttpServletResponse ; 33 34 import org.apache.struts.action.ActionForm; 35 import org.apache.struts.action.ActionForward; 36 import org.apache.struts.action.ActionMapping; 37 import org.objectweb.jonas.jmx.JonasManagementRepr; 38 import org.objectweb.jonas.jmx.JonasObjectName; 39 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 40 41 44 public class ApplySessionMailFactoryPropertiesAction extends EditMailFactoryPropertiesAction { 45 46 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 47 , HttpServletRequest p_Request, HttpServletResponse p_Response) 48 throws ServletException { 49 50 MailFactoryPropertiesForm oForm = (MailFactoryPropertiesForm) m_Session.getAttribute("mailFactoryPropertiesForm"); 52 String name = oForm.getMailFactoryName(); 54 try { 55 boolean mimePartFactory = false; 57 Properties props = getPropsFromForm(oForm, mimePartFactory); 58 Boolean fromFile = new Boolean (true); 59 Object [] aoParam = { name, props, fromFile }; 60 String [] asSign_3 = { "java.lang.String", "java.util.Properties", "java.lang.Boolean" }; 61 JonasManagementRepr.invoke(JonasObjectName.mailService(), "createMailFactoryMBean", aoParam, asSign_3); 62 m_WhereAreYou.setCurrentJonasDeploymentType(WhereAreYou.DEPLOYMENT_MAIL); 64 refreshTree(p_Request); 65 } catch (Throwable t) { 66 addGlobalError(t); 67 saveErrors(p_Request, m_Errors); 68 return (p_Mapping.findForward("Global Error")); 69 } 70 m_Session.removeAttribute("mailFactoryPropertiesForm"); 72 return (p_Mapping.findForward("ActionListMailFactories")); 73 } 74 } 75 | Popular Tags |