1 25 26 package org.objectweb.jonas.webapp.jonasadmin.catalina; 27 28 import java.io.IOException ; 29 import java.util.ArrayList ; 30 import java.util.Collections ; 31 import java.util.Iterator ; 32 33 import javax.management.ObjectName ; 34 import javax.servlet.ServletException ; 35 import javax.servlet.http.HttpServletRequest ; 36 import javax.servlet.http.HttpServletResponse ; 37 38 import org.apache.struts.action.ActionForm; 39 import org.apache.struts.action.ActionForward; 40 import org.apache.struts.action.ActionMapping; 41 import org.objectweb.jonas.jmx.CatalinaObjectName; 42 import org.objectweb.jonas.webapp.jonasadmin.JonasAdminJmx; 43 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 44 45 48 public class ListConnectorsAction extends CatalinaBaseAction { 49 50 52 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 53 , HttpServletRequest p_Request, HttpServletResponse p_Response) 54 throws IOException , ServletException { 55 m_WhereAreYou.selectNameNode(getTreeBranchName(DEPTH_SERVER) + WhereAreYou.NODE_SEPARATOR 57 + "protocols" + WhereAreYou.NODE_SEPARATOR + "connectors", true); 58 try { 59 ArrayList al = new ArrayList (); 61 Iterator it = JonasAdminJmx.getListMBeanName(CatalinaObjectName.catalinaConnectors( 62 m_WhereAreYou.getCurrentCatalinaDomainName())).iterator(); 63 while (it.hasNext()) { 64 al.add(new ConnectorItem(new ObjectName (it.next().toString()) 65 , m_WhereAreYou.getApplicationServerPort())); 66 } 67 Collections.sort(al, new ConnectorItemByPort()); 69 p_Request.setAttribute("listConnectors", al); 71 } 72 catch (Throwable t) { 73 addGlobalError(t); 74 saveErrors(p_Request, m_Errors); 75 return (p_Mapping.findForward("Global Error")); 76 } 77 return (p_Mapping.findForward("Catalina Connectors")); 79 } 80 81 } 82 | Popular Tags |