1 25 26 package org.objectweb.jonas.webapp.jonasadmin.resource; 27 28 import java.io.IOException ; 29 import java.util.ArrayList ; 30 import java.util.Iterator ; 31 32 import javax.servlet.ServletException ; 33 import javax.servlet.http.HttpServletRequest ; 34 import javax.servlet.http.HttpServletResponse ; 35 36 import org.apache.struts.action.ActionForm; 37 import org.apache.struts.action.ActionForward; 38 import org.apache.struts.action.ActionMapping; 39 import org.objectweb.jonas.webapp.jonasadmin.JonasAdminJmx; 40 import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction; 41 42 45 46 public class ListMailFactoriesAction extends JonasBaseAction { 47 48 50 52 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 53 , HttpServletRequest p_Request, HttpServletResponse p_Response) 54 throws IOException , ServletException { 55 56 try { 58 ArrayList alSessionDeployable = JonasAdminJmx.getSessionMailFilesDeployable(); 59 ArrayList alMimePartDeployable = JonasAdminJmx.getMimePartMailFilesDeployable(); 60 ArrayList alDeployed = JonasAdminJmx.getMailFilesDeployed(m_WhereAreYou); 61 62 ArrayList al = new ArrayList (); 63 String sName; 64 boolean bDeployed; 65 Iterator it = alSessionDeployable.iterator(); 66 while (it.hasNext()) { 67 sName = it.next().toString(); 68 bDeployed = alDeployed.contains(sName); 69 al.add(new MailFactoryItem(sName, bDeployed, "session")); 70 } 71 it = alMimePartDeployable.iterator(); 72 while (it.hasNext()) { 73 sName = it.next().toString(); 74 bDeployed = alDeployed.contains(sName); 75 al.add(new MailFactoryItem(sName, bDeployed, "mimepart")); 76 } 77 p_Request.setAttribute("listMailFactories", al); 80 } 81 catch (Throwable t) { 82 addGlobalError(t); 83 saveErrors(p_Request, m_Errors); 84 return (p_Mapping.findForward("Global Error")); 85 } 86 return (p_Mapping.findForward("MailFactories")); 88 } 89 } 90 | Popular Tags |